radio buttons

Hello Again,

I am working on the same form as earlier.

I would like in each section to use radio buttons so that they can not choose more than one selection.

But I noticed that if you choose a radio button in the first section

then you choose one in another - it deselects the first one.

how can I have them work so that each section they can choose one answer (except the science fiction one)

Thank you again!

http://www.ussniagara-sfi.org/untitled11.html

J


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

another form question:

why on safari the borders are grey but on FF it is red? Love the red

J
On Feb 14, 2011, at 1:36 PM, Julie Maxwell Allen wrote:

Hello Again,

I am working on the same form as earlier.

I would like in each section to use radio buttons so that they can not choose more than one selection.

But I noticed that if you choose a radio button in the first section

then you choose one in another - it deselects the first one.

how can I have them work so that each section they can choose one answer (except the science fiction one)

Thank you again!

http://www.ussniagara-sfi.org/untitled11.html

J


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Radio buttons, by design, are exclusive within a group. If you use
radio buttons, you basically doing the same thing as a picking list:
allowing a single choice from a group of options. In order to do this,
radio buttons have the name property and the value property, and a
properly-coded radio button group will look something like this:

<input type="radio" name="foo" value="one" /> One
<input type="radio" name="foo" value="two" /> Two
<input type="radio" name="foo" value="three" /> Three

Click any of these options, and submit the form, and only the one that
was checked will be sent to the form handler. The others will be
ignored by the browser.

Now if you are interested in asking two different questions, then all
you need to do is change the name attribute, and you’ll create an
entirely different group, which can be addressed separately from the
first group.

<input type="radio" name="bar" value="one" /> One
<input type="radio" name="bar" value="two" /> Two
<input type="radio" name="bar" value="three" /> Three

Now you should be able to check a single option from the foo group,
and another single option from the bar group, and when you submit the
form, the handler will get a value for both variables. I suspect that
in your case, you have the same name shared among all of your options.

If you want to allow users to choose more than one answer to a single
question, then that’s a job for a different control – the checkbox.
For those, you use a different naming scheme:

<input type="checkbox" name="condiments[ketchup]" value="1" />
<input type="checkbox" name="condiments[mustard]" value="1" />
<input type="checkbox" name="condiments[relish]" value="1" />

If the user selects two of the three, your form handler would receive
an array comprised of those two selected options. condiments = Array(mustard => 1, relish => 1) Here’s one other wrinkle: if they
didn’t choose any, your form handler would not receive ANYTHING for
that condiments variable.

Actually, the same is true for your radio buttons, too. If none of the
options are checked, then the input isn’t sent to the server at all.

One thing it’s important to remember – the physical layout of your
form elements on screen means less than nothing to the form handler.
All that the form handler will see when the form is submitted to it is
an associative array of form element names and their attendant values,
in source code order. It’s up to you to name those fields precisely
how your handler expects to receive them. Any layout or other style is
purely for the benefit of your users (which is not to say that it’s
unimportant, just that it’s not going to make any difference to the
server).

Walter

On Feb 14, 2011, at 1:36 PM, Julie Maxwell Allen wrote:

Hello Again,

I am working on the same form as earlier.

I would like in each section to use radio buttons so that they can
not choose more than one selection.

But I noticed that if you choose a radio button in the first section

then you choose one in another - it deselects the first one.

how can I have them work so that each section they can choose one
answer (except the science fiction one)

Thank you again!

http://www.ussniagara-sfi.org/untitled11.html

J


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thank you.

I will go in and change the name and the values in each group.

I do have the checkmarks set up in the one are I want them to be able to do multiple choices.

J
On Feb 14, 2011, at 2:05 PM, Walter Lee Davis wrote:

Radio buttons, by design, are exclusive within a group. If you use radio buttons, you basically doing the same thing as a picking list: allowing a single choice from a group of options. In order to do this, radio buttons have the name property and the value property, and a properly-coded radio button group will look something like this:

One
Two
Three

Click any of these options, and submit the form, and only the one that was checked will be sent to the form handler. The others will be ignored by the browser.

Now if you are interested in asking two different questions, then all you need to do is change the name attribute, and you’ll create an entirely different group, which can be addressed separately from the first group.

One
Two
Three

Now you should be able to check a single option from the foo group, and another single option from the bar group, and when you submit the form, the handler will get a value for both variables. I suspect that in your case, you have the same name shared among all of your options.

If you want to allow users to choose more than one answer to a single question, then that’s a job for a different control – the checkbox. For those, you use a different naming scheme:

If the user selects two of the three, your form handler would receive an array comprised of those two selected options. condiments = Array(mustard => 1, relish => 1) Here’s one other wrinkle: if they didn’t choose any, your form handler would not receive ANYTHING for that condiments variable.

Actually, the same is true for your radio buttons, too. If none of the options are checked, then the input isn’t sent to the server at all.

One thing it’s important to remember – the physical layout of your form elements on screen means less than nothing to the form handler. All that the form handler will see when the form is submitted to it is an associative array of form element names and their attendant values, in source code order. It’s up to you to name those fields precisely how your handler expects to receive them. Any layout or other style is purely for the benefit of your users (which is not to say that it’s unimportant, just that it’s not going to make any difference to the server).

Walter

On Feb 14, 2011, at 1:36 PM, Julie Maxwell Allen wrote:

Hello Again,

I am working on the same form as earlier.

I would like in each section to use radio buttons so that they can not choose more than one selection.

But I noticed that if you choose a radio button in the first section

then you choose one in another - it deselects the first one.

how can I have them work so that each section they can choose one answer (except the science fiction one)

Thank you again!

http://www.ussniagara-sfi.org/untitled11.html

J


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Erm – page 290 of the Freeway5 Reference pdf (radio buttons and clusters)?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options