javascript: radio buttons

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Apr 2005
Posts: 4
Reputation: ss_asp is an unknown quantity at this point 
Solved Threads: 0
ss_asp ss_asp is offline Offline
Newbie Poster

javascript: radio buttons

 
0
  #1
May 8th, 2005
hi there,
can anyone help me out

my problem is this:

I have a form, with radio buttons (the number of buttons is not fixed, it will keep increasing)

for eg, if there are 2 radio buttons and no button is checked then
if user checks a radio button, then i should display a message saying that
"You have selected the value"

but if already one radio button is selected and he is selecting the other button, I should display the confirmation message asking him "Whether he wish to change the value"
I am not able to display different alert messages for radio buttons checked or unchecked
(the code for changing etc are done in asp)

I am a novice to javascript..
Can u pls help me out on this


Thanks in advance
Regards
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 182
Reputation: alpha_foobar is an unknown quantity at this point 
Solved Threads: 3
alpha_foobar's Avatar
alpha_foobar alpha_foobar is offline Offline
Junior Poster

Re: javascript: radio buttons

 
0
  #2
May 12th, 2005
I suspect you'll need to set a flag indicating whether a user has already checked a radio button...

Then attach an event to each radio, so when the user selects it it checks the flag.... if its true, then alert: "You have selected the value"

else: prompt: "Whether he wish to change the value"

I sugest a less gender specific prompt... your love life will improve... unless you are a girl.. in which case it would make little difference...

please don't flame me.. i've been on drugs for a minor operation today...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC