Geeks Talk

Prepare for your Next Interview




radiobuttons problem....

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 ...


Go Back   Geeks Talk > Web Development > JavaScript

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 01-10-2007
Contributing Member
 
Join Date: Sep 2006
Location: bangalore, india
Posts: 1,007
Thanks: 0
Thanked 76 Times in 64 Posts
psuresh1982 will become famous soon enough
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
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-11-2007
Contributing Member
 
Join Date: Sep 2006
Location: bangalore, india
Posts: 1,007
Thanks: 0
Thanked 76 Times in 64 Posts
psuresh1982 will become famous soon enough
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
Reply With Quote
  #3 (permalink)  
Old 03-17-2007
Expert Member
 
Join Date: Oct 2005
Location: india,cochi,bangalore
Posts: 395
Thanks: 2
Thanked 8 Times in 7 Posts
vmshenoy is on a distinguished road
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.
Reply With Quote
  #4 (permalink)  
Old 03-17-2007
Contributing Member
 
Join Date: Sep 2006
Location: bangalore, india
Posts: 1,007
Thanks: 0
Thanked 76 Times in 64 Posts
psuresh1982 will become famous soon enough
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
Reply With Quote
Reply

  Geeks Talk > Web Development > JavaScript


Thread Tools
Display Modes


Similar Threads

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


All times are GMT -4. The time now is 01:09 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved