Prepare for your Next Interview
This is a discussion on radiobuttons problem.... within the JavaScript forums, part of the Web Development category; In my webpage form i am using 5 radio buttons. user saw the different fields according to the selection of radiobuttons. How can i aceive this one? becasue all the ...
|
|||
|
radiobuttons problem....
In my webpage form i am using 5 radio buttons. user saw the different fields according to the selection of radiobuttons. How can i aceive this one? becasue all the radiobuttons have the same name. In select box there is a option to find SelectedIndex. Is ther any option here ?
--------------------- suresh |
| Sponsored Links |
|
|||
|
Re: radiobuttons problem....
Hi Friends i solve this problem just now...I want to share my experience.
Using the following code you can do it... if(document.formname.radiobuttonname[0].checked) { do your code here. } The above code is working fine....If you have anyother idea post here.. waiting for your reply.. ----------------------- suresh |
|
|||
|
Re: radiobuttons problem....
hi suresh
i amnot getting ur question exactly!though u have answered it, please tell me where to use exactly. what i mean is that though the radio buttons have same name, they have different values , right? so cannot we do the same by using String ss[]=getParameterValues("name");//name is name of radio button and use some loop and doing if(ss[i].cehcked ==true) {ur code; } arenot they same? Also please tell regarding how to use CHECKBOXES and COMBOBOX expecting good answer!bye
__________________
:) NEVER SAY DIE. |
|
|||
|
Re: radiobuttons problem....
hi vmshenoy,
The main use of radiobutton is user allowed to select only once in the list of options. If you use same name of all the radiobuttons then only you acheive the above. Ohterwise user select multiple options. Checkbox do the second one. At that time of writing this question i don't know how to write the code for getting the user selected button value. For example if we use four radiobuttons science, maths, english, tamil. These are all radiobutton values. All the radiobutton has the same name subject. If user select science we show some of code. If he select maths we show another different code. Here i want the value of user selected radiobutton. Previously i know only to check whether user select a any one of the radiobutton or not. But i don't know how to get the exact selected radiobutton value. I am writing the javascript code... I think you expect the javacode. am i correct? -------------------------- suresh |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| div tag problem... | psuresh1982 | JavaScript | 3 | 02-03-2007 09:05 AM |
| Cellspacing problem..... | psuresh1982 | Web Design | 1 | 01-14-2007 10:00 AM |
| money problem.... | psuresh1982 | Brainteasers | 3 | 01-09-2007 06:45 AM |
| Problem for my post.... | psuresh1982 | Suggestions & Feedback | 1 | 12-14-2006 04:32 AM |
| One more Mathematical problem..? | psuresh1982 | Brainteasers | 2 | 11-17-2006 07:13 AM |