日期:2014-05-16 浏览次数:20358 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#myform").submit(function(){ return !!$.trim($("#content").val()); }); }); </script> </head> <body> <form id="myform" name="myform" action="tset2.html" > 文字不为空才能提交: <input id="content" type="text" value=""/> <input type="submit" id="submita" value="提交"/> </form> </body> </html>