从包含的已发布表单获取值列表
我有一个简单的形式:
<form id="myForm" method="post"
action="../SentinelOperationsUI/SystemAuditView.aspx" class="formular">
<fieldset>
<legend>
Buy-In
</legend>
<label>
<select id="buyIn" name="buyIn" class="validate[required]">
<option value=""></option>
<option>New System Subscription - Third Party System Evolution - Five Year Buy-In</option>
<option>New System Subscription - ABB System Evolution - Three Year Buy-In</option>
<option>New System Subscription - Three Year Buy-In</option>
<option value="SID-repeated">Plant Site Subscription - Buy-In plus Synchronization</option>
</select>
</label>
</fieldset>
<fieldset class="SIDContainer" style="display: none;">
<legend>
SID (repeated)
</legend>
<label>
<input type="text" class="SID" style="text-transform: uppercase;"/>
<input type="button" value="Add" class="addSIDToList" style="display: none;" />
</label>
<ul class="SIDList" name="SIDList"
style="text-transform: uppercase; list-style: disc; "></ul>
</fieldset>
<input class="submit" type="submit" value="Submit"/>
</form>
ul-list 通过 jquery 填充。有没有什么聪明的方法可以读取我发布到的页面上发布的值?或者我需要使用 $.post 手动发布它们?谢谢
I have a simple form:
<form id="myForm" method="post"
action="../SentinelOperationsUI/SystemAuditView.aspx" class="formular">
<fieldset>
<legend>
Buy-In
</legend>
<label>
<select id="buyIn" name="buyIn" class="validate[required]">
<option value=""></option>
<option>New System Subscription - Third Party System Evolution - Five Year Buy-In</option>
<option>New System Subscription - ABB System Evolution - Three Year Buy-In</option>
<option>New System Subscription - Three Year Buy-In</option>
<option value="SID-repeated">Plant Site Subscription - Buy-In plus Synchronization</option>
</select>
</label>
</fieldset>
<fieldset class="SIDContainer" style="display: none;">
<legend>
SID (repeated)
</legend>
<label>
<input type="text" class="SID" style="text-transform: uppercase;"/>
<input type="button" value="Add" class="addSIDToList" style="display: none;" />
</label>
<ul class="SIDList" name="SIDList"
style="text-transform: uppercase; list-style: disc; "></ul>
</fieldset>
<input class="submit" type="submit" value="Submit"/>
</form>
The ul-list gets populated through jquery. Is there any smart way to read the posted values at the page that im posting to? Or do i need to post them manually using $.post? Thanks
如果您使用 li 填充 ul,每个 li 都包含一个包含实际值(无论是否隐藏)的输入元素,则您可以只发布页面,并且您的值应该发送到服务器。当然,您可以通过脚本来完成此操作,只需将值添加到某个对象(或从 DOM 树手动读取它们),然后通过某些 AJAX 方法(如 $.post)将该对象传递到服务器。
If you populate the ul with li's that each contain an input element that contains the actual value (whether or not hidden), you can just post the page and your values should be send to the server. Of course you can do it with scriping and just add the values to some object (or read them manually from the DOM tree) and pass that object to the server through some AJAX method like $.post.