I started using the jquery plugin for validation and am puzzled why it's not working, here is my javascript code for it: "
$(document).ready(function() {
$('#shipper_form').validate({
errorLabelContainer: "#errors",
rules: {
email: {
required: true,
email: true
},
business: "required",
address: {
required: true,
},
zipcode: {
required: true,
},
phone: {
required: true,
},
contact_name: {
required: true,
},
},
messages : {
email : "Required Email *",
business : "Required Business *",
address : "Required Address *",
zipcode : "Required Zip Code*",
phone : "Required Phone*",
contact_name : "Required Contact Name*",
},
submitHandler: function (form) {
return false;
}
});
});
</script>"
Form:
<div id="errors"></div>
<form method="post" action="signup.php">
<table cellspacing="4" cellpadding="4">
<tr>
<td>
<input type="text" id="email" name="email" style="width: 300px;" class="form-control placeholder" placeholder="Email Address">
<span id="email_success" class="glyphicon glyphicon-check" style="color: green; display: none;"></span>
</td>
</tr>
<tr>
<td>
<input type="text" id="business" name="business" style="width: 300px;" class="form-control placeholder" placeholder="Business Name or DBA">
<span class="glyphicon glyphicon-check" style="color: green; display: none;"></span>
</td>
</tr>
</table>
</form>
The error messages shows up for email, but not for business or any of the other ones, I'm not sure what I'm doing wrong. Thanks.
#shipper_formelement? No element has that ID name...