我是 Jquery 验证的新手(http://docs.jquery.com/Plugins/Validation)
我有一个动态表格。我需要知道是否可以验证这样的表单:
<form ...>
<div class="multi-city">
<div class="controls visible">
<label for="id_form-0-city_input">City</label>
<input type="text" name="form-0-city_input" class="city-input ui-autocomplete-input" id="id_form-0-city_input" autocomplete="off">
<p style=""><a href="#" class="delete">Remove</a></p>
</div>
<input type="hidden" id="id_form-0-city" name="form-0-city">
<div class="controls visible">
<label for="id_form-1-city_input">City</label>
<input type="text" name="form-1-city_input" class="city-input ui-autocomplete-input" id="id_form-1-city_input" autocomplete="off">
<p style=""><a href="#" class="delete">Remove</a></p>
</div>
<input type="hidden" id="id_form-1-city" name="form-1-city">
<div class="controls hidden">
<label for="id_form-2-city_input">City</label>
<input type="text" name="form-2-city_input" class="city-input ui-autocomplete-input" id="id_form-2-city_input" autocomplete="off">
<p style=""><a href="#" class="delete">Remove</a></p>
</div>
</div>
</form>
基本上我需要验证“.controls.visible”。通过代码:
$('.multi-city .controls.visible')
我应该使用什么策略来验证这个动态字段?
有任何想法吗?
此致,