Reputation: 739
I have a simple form with basic info e.g.
<label>*Name:</label> [inputbox]
<label>*email:</label> [inputbox]
<label>Company:</label> [inputbox]
<label>Phone:</label> [inputbox]
[submit]
I just want simple validation that turns the input box border red and the text e.g. "*name" red.... I think many validation scripts might be a bit heavy for this simple functionality...
Can anyone reocomend something simple to achieve validation as per above please?
Upvotes: 2
Views: 893
Reputation: 60506
One lightweight way ist to use jQuery Validation
Html
<label for="Company">Company:</label>
<input id="Company" type="Text" name="Company"/>
jQuery
$("#YourFormId").validate({
rules: {
Company: "required",
},
messages: {
Company: "Please enter your Company",
}
});
Upvotes: 3