Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Making a SELECT unsuccessful

Reply
Thread Tools

Making a SELECT unsuccessful

 
 
August Karlstrom
Guest
Posts: n/a
 
      11-24-2008
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
 
Reply With Quote
 
 
 
 
SAZ
Guest
Posts: n/a
 
      11-24-2008
In article <ggel2r$jqa$(E-Mail Removed)>, http://www.velocityreviews.com/forums/(E-Mail Removed) 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.
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      11-24-2008
SAZ wrote:

> In article <ggel2r$jqa$(E-Mail Removed)>, (E-Mail Removed) 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/

 
Reply With Quote
 
richard
Guest
Posts: n/a
 
      11-25-2008
On Mon, 24 Nov 2008 22:13:34 +0200, "Jukka K. Korpela"
<(E-Mail Removed)> wrote:

>SAZ wrote:
>
>> In article <ggel2r$jqa$(E-Mail Removed)>, (E-Mail Removed) 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"?
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      11-25-2008

"richard" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Mon, 24 Nov 2008 22:13:34 +0200, "Jukka K. Korpela"
> <(E-Mail Removed)> wrote:
>
>>SAZ wrote:
>>
>>> In article <ggel2r$jqa$(E-Mail Removed)>, (E-Mail Removed) 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?


 
Reply With Quote
 
bgold12
Guest
Posts: n/a
 
      11-25-2008
On Nov 24, 11:34*am, August Karlstrom <(E-Mail Removed)> 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
 
Reply With Quote
 
August Karlstrom
Guest
Posts: n/a
 
      11-25-2008
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
 
Reply With Quote
 
Kiran Makam
Guest
Posts: n/a
 
      11-26-2008
On Nov 26, 2:10*am, August Karlstrom <(E-Mail Removed)> 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
 
Reply With Quote
 
Kiran Makam
Guest
Posts: n/a
 
      11-26-2008
On Nov 26, 2:10*am, August Karlstrom <(E-Mail Removed)> 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
 
Reply With Quote
 
August Karlstrom
Guest
Posts: n/a
 
      11-26-2008
Kiran Makam wrote:
> On Nov 26, 2:10 am, August Karlstrom <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search for information unsuccessful. turtill@hotmail.com Computer Support 10 01-14-2007 12:05 AM
ping translates but unsuccessful onlineviewer Cisco 2 03-21-2006 08:17 PM
A short but unsuccessful script for calling a Java app. Stan Goodman Java 14 08-27-2005 09:46 AM
pc-to-pc voip: unsuccessful so far Mark Smith VOIP 3 03-22-2005 08:02 AM
i was unsuccessful in sending email using asp =?Utf-8?B?c2FnYXI=?= ASP .Net 3 02-22-2005 10:27 PM



Advertisments