开发者

form validate using jquery

开发者 https://www.devze.com 2023-03-06 19:49 出处:网络
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\">
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....."));

})
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号