FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Use Javascript to Validate from

 


Shike
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.
hexkid
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.
Shike
Makes sense. Smile
Shike
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.
hexkid
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 Smile
Shike
I think I'll just stick with what I've got. Smile It seems that if I were to use the javascript, I would only be adding complexity instead of simplifying.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.