I am using livevalidation script on my contact form.But i dont know what is the problem whenever i click submitt or send button.
It just only checks the dropdown selection and other fields go empty and form is validated. I checked every example on livevalidation site but no help. Mine is not working….
It dont check the presense function in all my fields……..I dont know what to do
You can check my contact page online here.link text
If you need code then i am pasting it here toooooo……..
Code for form is here
<div class="subFillC">
<form id="form1" action="contactengine.php" method="post" name="form1">
<p><label for="name">Name</label> <input type="text" name="name" id="Name" size=
"30" /> </p>
<p><label for="email">Email</label> <input type="text" name="email" id="Email" size=
"30" /></p>
<p><label for="web">Select Option</label> <select name="service" id="service">
<option value="None" selected="selected">
None
</option>
<option value="Website Design">
Website Design
</option>
<option value="Website Redesign">
Website Redesign
</option>
<option value="Logo/Corporate Design">
Logo Design/Corporate Design
</option>
<option value="Other">
Other
</option>
</select></p>
<p><label for="email">What is <img src="images/cap.jpg" width="50" height=
"15" /></label> <input type="text" name="cap" id="cap" size="30" /></p>
<p><label for="message">Message</label>
<textarea id="Messagefield" name="message" cols="30" rows="10"></textarea>
Send
And in the end i have script just after the form tag
which is below
new LiveValidation(‘Name’, { wait: 500 }).add(Validate.Presence);new LiveValidation(‘Email’, { wait: 500 }).add(Validate.Email);
new LiveValidation(‘Messagefield’, { wait: 500 }).add(Validate.Presence);var service = new LiveValidation(‘service’ , {onlyOnSubmit: true });service.add( Validate.Exclusion, { within: [ ‘None’ ] } );
You are not correctly calling validation for all the fields. You must make an instance of LiveValidation object before calling the add function.
For each field (Name, Email, MessageField) replace:
With:
Here is complete JS snippet with LiveValidation placed inside document.ready jQuery function that will execute when DOM is ready: