• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Radio Buttons

 
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I'm confused about passing parameters using Radio buttons.
suppose I have a form in AAA.html as:


Now, I have named all the radio buttons the same, since I only
want one of them to be selected.
When submitting this information, a new window is opened using...


If (in a script in BBB) I try to retrieve the 'diff' parameter, it doesn't work, I think thats because 'diff' is an array of values.

So I have to use something like

to extract the value, but this just gives the 3rd value of the 'diff' array
(I think), I want to retrieve the value associated with the box that has been checked.
So if the 'Easy' box is checked, I want to retrieve "1", and so on...

Can anyone explain how this is done?
Thanks for any help.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to test each radio element of the array for the checked attribute.
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, I think I got what you mean.
I can ignore the values and in my BBB.html page use


I'll try it now, thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic