Jump to content

Problem with Username Checker


dizzy1

Recommended Posts

Alright ive made a register which allows me to check if the username already exists that works fine.

 

BUT i need to get it so if it doesnt exist the form doesnt submit.

 

javascript

 

function checkUsername ( form )
{

}

 

html

 

<form action="test.php" method="post" onsubmit="return checkUsername (this);"> 

<input type="text"  name="txtbox1" onblur="checkUser(this.value);" 	   
/> 

<div id='RegisterResult'></div>

</form>

 

The RegisterResult brings back if the username is avaliable or unavaliable from another page but how can i bring back a 0 or 1 in javascript so i know if it avaliable or not.

 

Link to comment
Share on other sites

Not a huge ammount,

 

so far what it does is:

 

1.User Types in Textbox, onblur.

2.Checks Database.

3.Displays If it USERNAME already exists in DB.

 

 

what i need is:

4.Variable with YES in OR NO.

 

 

Then when i submit i can call the javascript fuction to check if Username=YESS and if so RETURN TRUE.

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.