PHP Class and Ajax in action!!
I am a php class that is validating input fields.. I want to use ajax ..
Regis.php // registration page
as my form action is self... so i am validating on the same page!!!
Should i create a separate page for AJAX response! as ajax check the echo's from any specific page!!
More if i want to get the response for two fields should i write the ajax two times?
Any hint or a standard way? Plz
but if i want to append the error messages at the front of each field how can i do.. more check the availability of any specific field like email?
With that, if you get an error message for "last_name", you could just reference "last_name_error" as the element to add your error text to (or clear its value if that field no longer has an error but some other field does).
<label for="last_name">Last Name:<span id="last_name_error"></span></label>
<input type="text" name="last_name" id="last_name" /></div>
what do u mean by this
//If you're using JQuery, it should be relatively easy to loop through the JSON object
how to use to generate errors at the front of each field on keyup ?
html5 has built-in validation for form fields and there are polyfills for non-compliant browsers.
that should be enough to "generate errors at the front of each field on keyup".
in a situation where a user signs up or logs in, i would rely on php to validate authentication.
on sign up i just want to check the availability of my two fields
check from database and then show messages at the front of input fields?
i am using ajax for this.. i dot want to write ajax call two times for validation from database..
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)