onblur validate value

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
bouncer
Forum Contributor
Posts: 162
Joined: Wed Feb 28, 2007 10:31 am

onblur validate value

Post 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
thiscatis
Forum Contributor
Posts: 434
Joined: Thu Jul 20, 2006 11:00 am

Post by thiscatis »

The most common way is using AJAX.
Have a google search for AJAX FORM VALIDATION and you'll find tons of examples!
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post 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.
Post Reply