Hello,
on 05/09/2008 01:07 PM Ronald Raygun said the following:
I have a form, which contains a textfield for a user to enter their
username. I want to provide a button that allows the user to check to
see whether that username has already been taken up by someone else (a
bit like the functionality available when signing up for hotmail.com)
My question is:
1). How can I send the text entered in the text box to a server side PHP
script?
2). How do I receive the response (simple true or false) from the server
side, back in the form?
You may want to take a look at this form class. It lets you submit the
form without page reloading using AJAX. You can connect the textfield
ONCHANGE event to the AJAX form submission.
That makes it execute the same script that generated the form, except
that your script will be able to tell whether the form is being
submitted via AJAX so you can check the user name. In response, you can
update any parts of the page to tell the user whether the name is taken.
http://www.phpclasses.org/formsgeneration
I don't have an example script to do exactly that, but there is one
example script to submit the form via AJAX here:
http://www.meta-language.net/forms-e...test_ajax_form
You may also want to watch this tutorial video:
http://www.phpclasses.org/browse/vid...ugin-ajax.html
--
Regards,
Manuel Lemos
PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/