Jump to content

username validation?


cshoffie

Recommended Posts

Hey everyone, first post! :) I hope I can get some help as this seems like a good site to get it from. Anyway on to the question...

 

I'm coding a customer registration system for my business. I'm giving the user the option of having a user name of their choice. I'm primarily using PHP/MySQL, but I think I need a little help from Javascript... if he can do it. :)

 

Basically what I want to do is have an "Available?" button right next to the user name input field so the customer can click it and check to see if it's already taken or not, but what I want it to do is popup a window with the results using PHP. The only problem is that the only way I know how to transfer a $_GET variable to a PHP script is to obviously have the WHOLE form submitted. I don't want that. Is it possible to just have just the user name input field processed WITHOUT processing the whole form and having all of the other entries the user put into the form disappear upon reload?

 

In a nutshell, I need to get whatever the user inputs into ONLY that field and have it submit the results to another script, without submitting the ENTIRE form.

 

I hope you get what I'm saying....

 

Thanks!

Link to comment
Share on other sites

Try something like this

<input type="text" name="username" id="username">
<a href="#" onclick="window.open('check_username.php?username='+document.getElementById('username').value, '', 'width=250, height=150'); return false;">Available</a>

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.