I have a search form that I would like to use Javascript to validate (instead of the php script I currently have) so that it wont send to the server to validate and I can reduce the amount of, well "clutter" in myscript. (I have some trimming to do anyway). I also wanted to set the script so it didnt have to go to the server if they had invalid characters in their search.
Use Javascript to Validate from
| Shike wrote: |
| I have a search form that I would like to use Javascript to validate (instead of the php script I currently have) |
JavaScript can be bypassed. You always (I repeat, always) need to validate on the server. Tha validation on the client is an extra you provide (or not) to make life easier to the users, never a substitute for server validation.
Makes sense. 
Ok, I won't remove the validation in my PHP script, But by using javascript I can reduce the server's load. So only searches that pass throught eh javascript Validation will actually make it to the server (reducing badwidth usage and such).
Since I am very green in regards to javascript any help would be useful.
Since I am very green in regards to javascript any help would be useful.
| Shike wrote: |
| only searches that pass throught eh javascript Validation will actually make it to the server |
You have absolutely no way to know if what was submitted to the server passed through the JavaScript validation.
Anyway ... try Googling
I think I'll just stick with what I've got.
It seems that if I were to use the javascript, I would only be adding complexity instead of simplifying.
