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

Member Avatar for diafol

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.

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

Member Avatar for diafol

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.