Hi..everyone,
i have been designed a form then validate using php with ajax. I comple ted that php coding.But i know little bit about ajax.how to validate multiple fields in a form

stbuchok commented: Please don't hijack threads, create your own. -1

Recommended Answers

All 3 Replies

You mean you need to validate value "before" you send it out to the server? Then it is more likely JavaScript only. The Ajax part is only a part to send requests and receive back from the server for display. However, you still "have to" validate the data again on your server side because JavaScript can be tampered easily. JavaScript is there just for convenient for naive users.

Thank you for your valuable reply. ya its correct.for example the form has two fields. I used onBlur event for function call. Entering the cursor on the first field the second field also validated.its why plz help me..

You need onsubmit="return functionname(arguments, ...)" at the "form" tag. Not on each element. Using onblur is actually not a good idea on most cases because only 1 element can be focused at a time. Therefore, onblur may call all other elements once you move from one to the other element.

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.