Question:
I have ask this question before but I think I was misunderstood about "form" validation. Let me try again.
ebizartistry
2007-04-20 04:37:29 UTC
I am trying to include code for what I understand to be (client side validation). When more than or less than ten numbers are typed in the phone box a pop up message will appear. When a number is typed in a name section a pop up will happen. When a form area is left blank a pop up will occur and not let you proceed until it is corrected. I am really ‘green” can anyone help me.



"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">






























AmeriMex Restaurant

Comment Form

"Tell us what you think"











Please fill out the following form
and press the SUBMIT button below:





Your E-mail Address:





Your Name:





Your Phone Number:


Restaurant Name:



Choose One Only


Name if "Other":





Quality of Food


(Please Check One Only)



Unbelievable! Unmatched by any restaurant around!

Good Food!

Will Do In A Pinch!

Even the Cockroaches Stay Away!


Further Comments:






Quality of Service


(Please Check One Only)



I Was Treated Like a King!

Better Than Average!

Should Have Served Myself!


The Wait Staff Came Around As Often as Haley's Comet.






Further Comments:






Three answers:
BlueFeather
2007-04-20 07:27:14 UTC
I am giving you a sample page (after my comments) which you can copy and experiment with.

There are usually multiple ways of accomplishing any given task.

The sample page is just one way of demonstrating how to do validation of form elements.

For the sake of simplicity and brevity, it is about as BARE BONES as it can get.



COMMENTS

1. People are VERY UNLIKELY to provide personal information like name, phone, and email.

2. Radio buttons are typically used for mutually exclusive items; therefore, you don't need to say "Choose Only One"

3. Comments are usually optional so they don't need to be part of the verification

4. Since you require the phone number to be exactly 10 digits, you need to tell users not to use hyphens and/or provide an example

5. Users need to be told that the Reset button will clear the entire form - destroying anything they may already have entered

6. Note that I have made one of the radio buttons show up as checked (initially) - to show you how it is done

7. The verification code is not complete - I've given only enough to illustrate the process

8. There are ways to prevent entry of numbers when you expect only letters (and vice versa) but I have not included any of that (for brevity and because it can be confusing)

9. There is a LOT more that could be included but, hopefully, this will be enough to help you understand



Here is the sample page:









Demo









E-mail






Name






Phone







Quality of Food


Best


Good


Okay


Poor


Comments







Quality of Service


Best


Good


Okay


Poor


Comments











carolann
2016-05-19 08:02:01 UTC
Here is why you will never understand evolution: "And show me proof as to how that single cell just decided to one day evolve into insects, reptiles, mammals, humans etc." They didn't "decide" to do anything. Evolution is merely a way to describe a mechanism of action that leads to species diversification. Evolution is not some being or force sitting there going "And now YOU will grow legs and YOU will grow fur and YOU will grow flowers." It is a description. Like "blonde". Do you ask your hair why it "decided" to become what color it is? Do I know how the first cell came about? Not for sure, but there are certainly some interesting theories. Same for why single cells grouped together to become multicellular creatures, and then some of those developed nervous systems, and then a spine, and then legs, etc etc. Somehow, at some point, those things proved advantageous so that the entity that possessed a slight mutation survived better and was able to pass on the genes for that mutation. Over a great deal of time, itty bitty changes pile up and become big changes. Or did you honestly think that a wolf just gave birth to a miniature poodle one day? Selective breeding by humans manipulates evolution, wherein WE, not nature, perpetuate particular traits.
2007-04-20 06:35:05 UTC
This line means that the "submit" button does nothing but submit the data to the server.





This line determines the location of the cgi script which will receive and process the form data once it has been submitted.

This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...