![]() |
Javascript form validation
The noob has returned.
Generally, if I want to do form validation I use the following format: Code:
function validateForm(myForm) Code:
function validateForm(myForm) What are your thoughts? |
There are really too many variables when considering the creation and validation of a form. If you consider javascript to be a bad thing, is your form secured without it? Is the form client-side or server-side only, or a mix? Is the code going to include warnings that javascript is disabled (meaning required by the form)? Is the code in the first example as compact as it should be, or are you questioning the difference between the two based on structure and content vs. format for end result?
In order to answer the question to yourself, you would really need to define the parameters for the environment/users the form would be targeted for. Hmm... someone is trying to make you think. This must be a school lesson. :wacko: |
Anything that force me to turn JavaScript on a site I don't want to gives me bad vibes too...
|
Quote:
- If anything is being done server-side, server-side validation is inevitable (and therefore Javascript validation is not crucial). - With Javascript, less is more. I suppose the second could be used if the purpose of the form is such that Javascript has to be on anyway. It still doesn't seem like an ideal structure. |
Code:
function validateForm(myForm) At least that's how I understand it.:dunno: |
The current time is 08:11 PM (GMT) |
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.