form验证表单的一种实现方法。
<% form_for @rcrm_lead,:html=>{:multipart => true,:οnsubmit=>"return validate_lead_hi(this)"} do |@f| %>
<% form_for @rcrm_lead,:html=>{:multipart => true,:οnsubmit=>"return validate_lead_hi(this)"} do |@f| %>
function validate_lead_hi(thisform)
{
with (thisform)
{
if (validate_required(rcrm_lead_name,"姓名不能为空!!!")==false)
{rcrm_lead_name.focus();return false}
if (validate_required(rcrm_lead_certificateno,"身份证号码不能为空!!!")==false)
{rcrm_lead_certificateno.focus();return false}
if (validate_required(rcrm_lead_email,"电子邮件不能为空!!!")==false)
{rcrm_lead_email.focus();return false}
if (validate_required(rcrm_lead_graduation_certificate_number,"毕业证号不能为空!!!")==false)
{rcrm_lead_graduation_certificate_number.focus();return false}
}
}