|
-
Nov 13th, 2004, 08:38 AM
#1
Thread Starter
New Member
Javascript: Form Menu Boxes
Hello,
I am trying to extract the selected value from a menu box on a form, so I can use the value in a function.
In my function, I am currently using:
function1 {
var1 = theform.select1.text
...
}
I am calling the function as follows:
<select name="select1" ... onchange = "function1(this)" >
but var1 is not filling with any values
Also I need to be able to extract a value from a radio button group.
If the group is called RadioGroup1 and there are a number of radio buttons in the group.
To get the value of the button selected would it be
RadioGroup1.value or some other syntax.
Any ideas would be appreciated .
Thanks
-
Nov 14th, 2004, 08:26 AM
#2
if s is the select, you get the selected value with s.options[s.selectedIndex].value.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 14th, 2004, 08:56 AM
#3
Frenzied Member
Have I helped you? Please Rate my posts. 
-
Nov 16th, 2004, 06:10 AM
#4
Thread Starter
New Member
Thanks for that ,
One other question.
if I have 3 radio buttons , how would I - when I click on any of them I want to call a function and assign the radio button value to a variable.
I have no problem calling the function with the onClick event, but I cant seem to distinguish between the 3 buttons.
Was trying RadioGroup1[RadioGroup1.checked].value but it doesnt seem to work.
Any ideas appreciated.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|