Default Values For SELECT

Discussion in 'Javascript' started by HugeBob, Dec 26, 2006.

  1. HugeBob

    HugeBob Guest

    Hi All,

    I'm writing an OnReset handler and I'd like to know the default value
    of a select box: that is, what will the browser set the select box to
    after the handler completes. I know that TEXT inputs have the
    defaultValue attribute. But, is there a similar attribute for selects?

    Thanks.
     
    HugeBob, Dec 26, 2006
    #1
    1. Advertising

  2. HugeBob

    Evertjan. Guest

    HugeBob wrote on 26 dec 2006 in comp.lang.javascript:

    > I'm writing an OnReset handler and I'd like to know the default value
    > of a select box: that is, what will the browser set the select box to
    > after the handler completes. I know that TEXT inputs have the
    > defaultValue attribute. But, is there a similar attribute for selects?


    Clearly described here:

    <http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/defau
    ltvalue.asp>

    and here:

    <http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/input_ch
    eckbox.asp>

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Dec 26, 2006
    #2
    1. Advertising

  3. HugeBob

    HugeBob Guest

    Hi,

    Thanks for responding. The links you provided detail the defaultValue
    attribute for the INPUT type. There didn't seem to be a reference to a
    defaultValue property for the SELECT. I looked around
    (http://www.w3schools.com/htmldom/dom_obj_select.asp) and there doesn't
    seem to be this type of property for the SELECT control. There is,
    however, a defaultSelected property on the accompanying OPTION tags.
    I'll play with this and see what happens.

    Evertjan. wrote:
    > HugeBob wrote on 26 dec 2006 in comp.lang.javascript:
    >
    > > I'm writing an OnReset handler and I'd like to know the default value
    > > of a select box: that is, what will the browser set the select box to
    > > after the handler completes. I know that TEXT inputs have the
    > > defaultValue attribute. But, is there a similar attribute for selects?

    >
    > Clearly described here:
    >
    > <http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/defau
    > ltvalue.asp>
    >
    > and here:
    >
    > <http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/input_ch
    > eckbox.asp>
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress)
     
    HugeBob, Dec 27, 2006
    #3
  4. HugeBob

    HugeBob Guest

    Hi,

    Thanks for responding. The links you provided detail the defaultValue
    attribute for the INPUT type. There didn't seem to be a reference to a
    defaultValue property for the SELECT. I looked around
    (http://www.w3schools.com/htmldom/dom_obj_select.asp) and there doesn't
    seem to be this type of property for the SELECT control. There is,
    however, a defaultSelected property on the accompanying OPTION tags.
    I'll play with this and see what happens.

    Evertjan. wrote:
    > HugeBob wrote on 26 dec 2006 in comp.lang.javascript:
    >
    > > I'm writing an OnReset handler and I'd like to know the default value
    > > of a select box: that is, what will the browser set the select box to
    > > after the handler completes. I know that TEXT inputs have the
    > > defaultValue attribute. But, is there a similar attribute for selects?

    >
    > Clearly described here:
    >
    > <http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/defau
    > ltvalue.asp>
    >
    > and here:
    >
    > <http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/input_ch
    > eckbox.asp>
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress)
     
    HugeBob, Dec 27, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. micky

    default.mspx or default.do

    micky, Dec 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    513
    Andrew Robinson
    Dec 17, 2005
  2. Gaetan
    Replies:
    3
    Views:
    1,476
    Juan T. Llibre
    Feb 14, 2006
  3. Replies:
    2
    Views:
    903
  4. palmiere
    Replies:
    1
    Views:
    453
    Erwin Moller
    Feb 9, 2004
  5. WebRaster
    Replies:
    1
    Views:
    288
    Francisco Spaeth
    Oct 26, 2005
Loading...

Share This Page