我有以下代码来验证提交时的表单:
<form enctype='multipart/form-data'
action='ad_posting_process.php'
method='post'>
Price: <input type=text name=price
id="price" style=width:90px;>
<script type="text/javascript">
var f3 = new LiveValidation('price');
f3.add( Validate.Numericality );
</script>
Email: <input type=text name=email
id="email" style=width:240px;>
<script type="text/javascript">
var f20 = new LiveValidation('email');
f20.add( Validate.Email );
</script>
<script type="text/javascript">
var title = new LiveValidation( 'title', {onlyOnSubmit: true } );
title.add( Validate.Email );
var field2 = new LiveValidation( 'price', {onlyOnSubmit: true } );
field2.add( Validate.Acceptance );
var field3 = new LiveValidation( 'email', {onlyOnSubmit: true } );
field3.add( Validate.Presence );
</script>
<input type=submit name=action value=Post>
</form>
电子邮件验证正在工作,但如何在提交时验证整个表单?
问候: