Doesnt the case mess up in JS? The way I had it is the exact way the fields are used. If I grab the value of the textbox using the same code but changing the name (TravelPurpose) then it shows the value.
When I try this I get a JS Error saying that it is null or not a object. I created a test.html page that shows the form. I am just trying to find out if they select in Question 15 if School Related Study/Work was selected so then I can validate and make sure they typed in "What School?". I am just trying to validate before going to ASP which I know I can validate it in ASP. Any other ideas?
Ok I figured it out. Here is what it said on a webpage about this...
quote: The example determines which button is checked in each group and then displays the value in an alert box. We begin coding this example by making the two groups of radio buttons inside a <form>. I NAMEd the <form> "form1". Here's the code for the first group of "pet" buttons:
There are two important things to notice here. First, all of the radio buttons have the same NAME attribute -- "pet". This causes them to function as a group so that only one button can be selected at a time. It also sets the buttons up as a JavaScript array named "pet". The below would refer to the "Birds" button.
document.form1.pet[2]
The array is numbered beginning with zero. The assignment continues in the order in which the <input>s are coded. First coded is 0, next one is 1, etc.
The second thing to note is the use of a VALUE attribute. The VALUEs are all different. This is the data we can access with JavaScript. You cannot readily access the text labels of the radio buttons. We'll be dealing with the VALUE attribute's data.
document.form1.pet[0].value
The above would return a value of "Dogs". The "vegetable" radio button group is coded similarly. All of the "vegetable" buttons have the same name, so they'll work together as an array, but they all have different VALUEs coded into their <input> tags.
The whole goal here is to cycle through the array of radio buttons, find the checked one, and assign its VALUE to a variable for later use.