I'm validating the form input for example say First Name on click of a button.If empty i change the class to
.ValidateError
{
border: 3px solid #ff9600;
background: #ffebe9;
padding: 4px 4px 5px 4px;
color: #404040;
}
On focus on the text box i'm trying to remove this class from the input box using the following script on document.ready
$('#divPersonalInfo input').focusin(function () {
$(this).removeClass().addClass('input w220');
});
});
Here is the html code
<div id="divPersonalInfo" class="PersonalInfo">
<h2 id="hPersonal">
Personal Information
</h2>
<div class="FormColumn FloatLeft">
<label>
first name*
</label>
<br />
<input maxlength="100" id="txtFirstName" placeholder="First Name" class="input w220 "/>
</div>
<div class="FormColumn FloatLeft">
<label>
last name*
</label>
<br />
<input maxlength="100" id="txtLastName" placeholder="Last Name" class="input w220"/>
</div>
<div class="FormColumn FloatLeft">
<label>
email*
</label>
<br />
<input maxlength="100" id="txtPersonalEmailId" placeholder="will be seen when sending your web profile/app to your colleagues" class="input w220"/>
</div>
</div>
But the class isn't removed on focusin