Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   Making a SELECT unsuccessful (http://www.velocityreviews.com/forums/t645871-making-a-select-unsuccessful.html)

August Karlstrom 11-24-2008 04:34 PM

Making a SELECT unsuccessful
 
Hi,

Does anyone know if there is a way to make all options in a SELECT
element become unsuccessful so it behaves like a group of radio buttons
in which no button is checked?


August

SAZ 11-24-2008 07:43 PM

Re: Making a SELECT unsuccessful
 
In article <ggel2r$jqa$1@aioe.org>, fusionfile@gmail.com says...
> Hi,
>
> Does anyone know if there is a way to make all options in a SELECT
> element become unsuccessful so it behaves like a group of radio buttons
> in which no button is checked?
>
>
> August
>


Am I the only one that is thoroughly confused by this question?

Please restate your question in a different form, I have no idea what
you are trying to achieve.

Jukka K. Korpela 11-24-2008 08:13 PM

Re: Making a SELECT unsuccessful
 
SAZ wrote:

> In article <ggel2r$jqa$1@aioe.org>, fusionfile@gmail.com says...
>> Hi,
>>
>> Does anyone know if there is a way to make all options in a SELECT
>> element become unsuccessful so it behaves like a group of radio
>> buttons in which no button is checked?

[...]
> Am I the only one that is thoroughly confused by this question?


Probably not.

> Please restate your question in a different form, I have no idea what
> you are trying to achieve.


It's always a good idea to explain what you are trying to achieve, rather
than an assumed technical solution to an unspecified problem, especially
when the assumed solution is a dead end.

However, my crystal ball whispered to me that August was trying to ask "Is
it possible to have a SELECT element where no option has been pre-selected".
The answer is "No, not in any reliable manner, but if you just don't use the
SELECTED attribute, then most browsers behave that way." The good question
then is: Why would you rely on that?

--
Yucca, http://www.cs.tut.fi/~jkorpela/


richard 11-25-2008 01:10 AM

Re: Making a SELECT unsuccessful
 
On Mon, 24 Nov 2008 22:13:34 +0200, "Jukka K. Korpela"
<jkorpela@cs.tut.fi> wrote:

>SAZ wrote:
>
>> In article <ggel2r$jqa$1@aioe.org>, fusionfile@gmail.com says...
>>> Hi,
>>>
>>> Does anyone know if there is a way to make all options in a SELECT
>>> element become unsuccessful so it behaves like a group of radio
>>> buttons in which no button is checked?

>[...]
>> Am I the only one that is thoroughly confused by this question?

>
>Probably not.
>
>> Please restate your question in a different form, I have no idea what
>> you are trying to achieve.

>
>It's always a good idea to explain what you are trying to achieve, rather
>than an assumed technical solution to an unspecified problem, especially
>when the assumed solution is a dead end.
>
>However, my crystal ball whispered to me that August was trying to ask "Is
>it possible to have a SELECT element where no option has been pre-selected".
>The answer is "No, not in any reliable manner, but if you just don't use the
>SELECTED attribute, then most browsers behave that way." The good question
>then is: Why would you rely on that?


If the value of a button is either "on" or "off", then all that is
necessary is to make the value of all buttons "off".
Or could it not be possible to have one button "hidden"?

rf 11-25-2008 03:18 AM

Re: Making a SELECT unsuccessful
 

"richard" <member@newsguy.com> wrote in message
news:f0kmi4dq13do97uot3l83aon04nfld2a8k@4ax.com...
> On Mon, 24 Nov 2008 22:13:34 +0200, "Jukka K. Korpela"
> <jkorpela@cs.tut.fi> wrote:
>
>>SAZ wrote:
>>
>>> In article <ggel2r$jqa$1@aioe.org>, fusionfile@gmail.com says...
>>>> Hi,
>>>>
>>>> Does anyone know if there is a way to make all options in a SELECT
>>>> element become unsuccessful so it behaves like a group of radio
>>>> buttons in which no button is checked?

>>[...]
>>> Am I the only one that is thoroughly confused by this question?

>>
>>Probably not.
>>
>>> Please restate your question in a different form, I have no idea what
>>> you are trying to achieve.

>>
>>It's always a good idea to explain what you are trying to achieve, rather
>>than an assumed technical solution to an unspecified problem, especially
>>when the assumed solution is a dead end.
>>
>>However, my crystal ball whispered to me that August was trying to ask "Is
>>it possible to have a SELECT element where no option has been
>>pre-selected".
>>The answer is "No, not in any reliable manner, but if you just don't use
>>the
>>SELECTED attribute, then most browsers behave that way." The good question
>>then is: Why would you rely on that?

>
> If the value of a button is either "on" or "off", then all that is
> necessary is to make the value of all buttons "off".
> Or could it not be possible to have one button "hidden"?


What do buttons have to do with select and option elements?



bgold12 11-25-2008 12:30 PM

Re: Making a SELECT unsuccessful
 
On Nov 24, 11:34*am, August Karlstrom <fusionf...@gmail.com> wrote:
> Hi,
>
> Does anyone know if there is a way to make all options in a SELECT
> element become unsuccessful so it behaves like a group of radio buttons
> in which no button is checked?
>
> August


If I'm understanding you correctly, you want to create a <select>
element where all the <option>s are unselected. As far as I know,
there's no way to do this; there must always be one option selected in
the list. I think what people normally do is have one blank (or
"fake") option, which can be treated as the default. Then none of the
"actual" options will be selected.

bgold12

August Karlstrom 11-25-2008 09:10 PM

Re: Making a SELECT unsuccessful
 
August Karlstrom wrote:
> Hi,
>
> Does anyone know if there is a way to make all options in a SELECT
> element become unsuccessful so it behaves like a group of radio buttons
> in which no button is checked?


Apparently my question was not so clearly stated.

The term "successful control" is used by W3C to mean a control for which
a name/value pair is submitted. With this terminology an unchecked radio
button will become unsuccessful when the form it belongs to is submitted.

Ideally I think you should be able to change a choice made through radio
buttons to a drop-down list (or vise versa) without changing the program
which processes the submitted form (a kind of view-controller
independence). However, since at least one option in a SELECT element
will always be selected it will also be submitted.

Unless I am wrong I think I have answered my own question, i.e. it is
not possible.


August

Kiran Makam 11-26-2008 04:45 AM

Re: Making a SELECT unsuccessful
 
On Nov 26, 2:10*am, August Karlstrom <fusionf...@gmail.com> wrote:
> August Karlstrom wrote:
> > Hi,

>
> > Does anyone know if there is a way to make all options in a SELECT
> > element become unsuccessful so it behaves like a group of radio buttons
> > in which no button is checked?


You can make any form controls "unsuccessful" by don't giving it a
"name". If name attribute is not available that control will not get
submitted. For your scripting needs you can use the id attribute.

Form controls can also be made unsuccessful by disabling them.

- Kiran Makam

Kiran Makam 11-26-2008 04:48 AM

Re: Making a SELECT unsuccessful
 
On Nov 26, 2:10*am, August Karlstrom <fusionf...@gmail.com> wrote:
> August Karlstrom wrote:
> > Hi,

>
> > Does anyone know if there is a way to make all options in a SELECT
> > element become unsuccessful so it behaves like a group of radio buttons
> > in which no button is checked?


You can make any form control "unsuccessful" by not giving a "name".
If name attribute is not available that control will not get
submitted. For your scripting needs you can use the id attribute.

Form controls can also be made unsuccessful by disabling them.

- Kiran Makam

August Karlstrom 11-26-2008 05:51 PM

Re: Making a SELECT unsuccessful
 
Kiran Makam wrote:
> On Nov 26, 2:10 am, August Karlstrom <fusionf...@gmail.com> wrote:
>> August Karlstrom wrote:
>>> Hi,
>>> Does anyone know if there is a way to make all options in a SELECT
>>> element become unsuccessful so it behaves like a group of radio buttons
>>> in which no button is checked?

>
> You can make any form control "unsuccessful" by not giving a "name".


An option in a SELECT element do not have a name in the first place and
radio buttons are grouped by name so that will not work.

> If name attribute is not available that control will not get
> submitted. For your scripting needs you can use the id attribute.
>
> Form controls can also be made unsuccessful by disabling them.


That might be an option though (or maybe more of a "hack" in this case).

By the way, I have learned that, as with SELECT options, at least one
radio buttons must always be checked.


August


All times are GMT. The time now is 02:35 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.