$(document).ready(function()
{
$(".input").blur(function()
{
$(this).next(".validtest").removeClass().addClass('validating').text('...').fadeIn("slow");
$.post("validate.php",{ form_field:$(this).val() } ,function(data)
{
if(data=='no')
{
$(".validtest").fadeTo(200,0.1,function() //start fading the messagebox
{
$(this).addClass('error').fadeTo(900,1);
});
}
else
{
$(".validtest").fadeTo(200,0.1,function() //start fading the messagebox
{
$(this).addClass('ok').fadeTo(900,1);
});
}
});
});
});
Looking for this script to change the first span class after the input field... currently all it's doing is changing all .validtest(s) .. I'm stuck... any help would be greatly appreciated...
<td><input type="text" class="input" id="input1" name="input1" value="" maxlength="4"><span class="validcl"></span></td>
.....
<td><input type="text" class="input" id="input2" name="input2" value="" maxlength="4"><span class="validcl"></span></td>