saseow
Posts: 744
|
Posted: 04/09/2012, 10:50 PM |
|
I really need some guidance in how to implement AJAX validation.
As an example, I have an editable grid where users enter a code and the record is stored in a DB table via AJAX UpdateDB. The code entered must exist in another table that holds all the codes.
Now, in PHP using the validate row event it is a piece of cake. My question is:
Can I call this event using AJAX and pass back a 'good' or 'bad' reference. If so....how?
Or, am I going about this incorrectly and is there a better method to validation the code the user enters?
Hoping for some help here!
Trevor
|
|
|
clahti2
Posts: 107
|
Posted: 04/24/2012, 8:57 AM |
|
Quote saseow:
I really need some guidance in how to implement AJAX validation.
As an example, I have an editable grid where users enter a code and the record is stored in a DB table via AJAX UpdateDB. The code entered must exist in another table that holds all the codes.
Now, in PHP using the validate row event it is a piece of cake. My question is:
Can I call this event using AJAX and pass back a 'good' or 'bad' reference. If so....how?
Or, am I going about this incorrectly and is there a better method to validation the code the user enters?
Hoping for some help here!
Trevor
If the values exist in another table why would you not simply use a drop list populated from this other table rather than have the user type in the field?
|
|
|
saseow
Posts: 744
|
Posted: 04/24/2012, 10:48 AM |
|
Thank you for your input clahti2.
The problem is that the typing in of the codes has to be handled extremely fast i.e. as fast as the user can type using the number pad. Using AJAX the typing can be faster than the database updating as the AJAX calls will be buffered and continue even after the user has stopped typing and the DB interaction will then catch up. All the user does is type in a number and hit the ENTER key then the next number etc., etc. A list box will just never be as quick as is required.
What I have done is simply do the validation by showing the results in grid in an update panel. Each code has a description so if a description is missing in the results grid the code entered was not valid. Not the most elegant solution hence my query about AJAX validation.
Thanks again for the input clahti2.
|
|
|
|