Page 1 of 1

onblur validate value

Posted: Tue Aug 07, 2007 4:50 am
by bouncer
hi,

i have a form and inside this form i have a field that i have to validate, in this case see if the value exists in db, before insert it in a different table, but i don“t have any clue how to make this possible with javascript and the event onblur.

can someone provide me some ideas ? :roll:

thanks in advance

Posted: Tue Aug 07, 2007 4:58 am
by thiscatis
The most common way is using AJAX.
Have a google search for AJAX FORM VALIDATION and you'll find tons of examples!

Posted: Tue Aug 07, 2007 8:22 am
by Zoxive

Code: Select all

<script language="Javascript" type="text/javascript">

function validate(fld){
  fld = fld.value;
  alert('Attempting to Validate ' + fld + '!');
}

</script>

<input type="text" name="UserName" onBlur="validate(this);" />
That should get you in the right direction.

Ideas? Don't be afraid to try new things, and attempt them.

Trial and Error.