0

i want to Call a Div tag in validating a form.....that means i need a div call at the onblur condition....in that time i want to recieve a msg like this username is already exits....like that

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by diafol
0

I'd use ajax to give this info before the form was sent. That is onblur - check the db and place message in empty div. The prototype Ajax.Updater method is tailor-made for this.

0

pls help me in case of onblur condition..can we call a Div TAG under the username button?with out using Ajax....

0

Sure, but you'll have to reload the page if you don't want to use ajax. Just using javascript will not do - it can't access your database of names.

Standard pHp and js: have onblur event submit the form to your form handler script, it checks the entry vs. your db and returns a msg to the form page (OK or Not). This is very heavy on resources because your WHOLE page needs to be reloaded and usually the whole form data will be processed, so it could be awkward to separate a simple name query (onblur) from a "proper" submission (submit button).

The Ajax version:
onblur will call a js script to send and retrieve data from a very simple php file that can access your db. This is relatively painless and easy to isolate from a "proper" submit button action. If you're concerned about the complexity of Ajax - don't be. The prototype library (http://www.prototypejs.org) takes care of the ajax objects. Nice and simple.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.