I am new to javascript and working on a small form validation project…I have used external javascript file for this purpose but it is giving me problems.I have included this file properly in my html form but it is not updating any div or changing any color however this file is showing popup alerts…..Another thing is that when I copy and paste the same code directly into my html tags then it works fine……I dont know why this is happening ????
The html tags I have used are actually SPRING HTML tags…Are these tage creating problem????
<label for="edit-mail"> First Name<span class="form-required" title="This field is required.">*</span></label>
<form:input path="firstName" id="firstName" />
<div id="firstNameError"</div>
<form:errors path="firstName"/>
<div id='user-register_FirstName_errorloc' class="error_strings"></div>
Make sure that you’re returning
falseto prevent the default behavior of your button (which is to submit the form:See the difference here: http://jsfiddle.net/atc3B/