form validate using jquery
1,<input type="text" value="" size="60" id="field-you-0-value">
2,<input type="text" class="text" value="" size="60" id="field-test-0-value">
3, 开发者_如何学编程
<input type="submit" class="form-submit" value="Save" id="edit-submit" name="op">
the above is the submit button. i want to use jquery to do this. if the 1,2,3 input is no value. when he click the submit button. then alter a box. "you should write something."
this is my code. but it's too bad.
$(document).ready(function(){
if((#field-you-0-value).val()='' && .......)
$(#edit-submit).click(alert("test....."));
})
精彩评论