Checked option for radio type input boxes not working.

Discussion in 'HTML' started by Daniel Rudy, Aug 22, 2008.

  1. Daniel Rudy

    Daniel Rudy Guest

    What is the difference between these two code fragments?


    This one does not work. The radio button with the checked attribute is
    not checked at all.

    <table>
    <tbody>
    <tr>
    <td align="center"><input type="radio" name="pwdsel" value="never"
    disabled></td>
    <td nowrap>Never</td>
    <td align="center"><input type="radio" name="pwdsel" value="nextlogin"
    disabled></td>
    <td nowrap>Next Login</td>
    <td align="center"><input type="radio" name="pwdsel" value="normal"
    disabled></td>
    <td nowrap>Normal</td>
    <td align="center"><input type="radio" name="pwdsel" value="date"
    checked disabled></td>
    <td nowrap>Date</td>
    <td><image src="/images/balloon.png" border="0" width="25px"
    height="25px" onmousedown="toolTip('Never - Password will never
    expire.<br>Next Login - Password will expire on the next
    login.<br>Normal - Password will expire after the system configured
    duration.<br>Date - Password will expire after the specified
    time/date.')" onmouseup="toolTip()" onmouseout="toolTip()"></td>
    </tr>
    <tr>
    <td nowrap colspan="9">
    Y:<input type="text" name="pyear" size="4" maxsize="4" value="2008"
    disabled>
    M:<input type="text" name="pmonth" size="2" maxsize="2" value="08"
    disabled>
    D:<input type="text" name="pday" size="2" maxsize="2" value="22"
    disabled>
    H:<input type="text" name="phour" size="2" maxsize="2" value="09"
    disabled>
    M:<input type="text" name="pmin" size="2" maxsize="2" value="45"
    disabled>
    <image src="/images/balloon.png" border="0" width="25px"
    height="25px" onmousedown="toolTip('Y - Year<br>M - Month<br>D -
    Day<br>H - Hour<br>M - Minute')" onmouseup="toolTip()"
    onmouseout="toolTip()">
    </td>
    </tr>
    </tbody>
    </table>


    This one does work. The radio button with the checked attribute does
    show as checked.

    <table>
    <tbody>
    <tr>
    <td align="center"><input type="radio" name="pwdsel"
    value="never"checked disabled></td>
    <td nowrap>Never</td>
    <td align="center"><input type="radio" name="pwdsel" value="nextlogin"
    disabled></td>
    <td nowrap>Next Login</td>
    <td align="center"><input type="radio" name="pwdsel"
    value="normal"disabled></td>
    <td nowrap>Normal</td>
    <td align="center"><input type="radio" name="pwdsel" value="date"
    disabled></td>
    <td nowrap>Date</td>
    </tr>
    <tr>
    <td nowrap colspan="8">
    Y:<input type="text" name="pyear" size="4" maxsize="4" disabled>
    M:<input type="text" name="pmonth" size="2" maxsize="2" disabled>
    D:<input type="text" name="pday" size="2" maxsize="2" disabled>
    H:<input type="text" name="phour" size="2" maxsize="2" disabled>
    M:<input type="text" name="pmin" size="2" maxsize="2" disabled></td>
    </tr>
    </tbody>
    </table>

    Any ideas as to what I am doing wrong? This fails in both IE 7 and
    Seamonkey.

    --
    Daniel Rudy

    Email address has been base64 encoded to reduce spam
    Decode email address using b64decode or uudecode -m
     
    Daniel Rudy, Aug 22, 2008
    #1
    1. Advertising

  2. Daniel Rudy wrote:
    > What is the difference between these two code fragments?
    >
    >
    > This one does not work. The radio button with the checked attribute is
    > not checked at all.
    >
    > <table>
    > <tbody>
    > <tr>
    > <td align="center"><input type="radio" name="pwdsel" value="never"
    > disabled></td>
    > <td nowrap>Never</td>
    > <td align="center"><input type="radio" name="pwdsel" value="nextlogin"
    > disabled></td>
    > <td nowrap>Next Login</td>
    > <td align="center"><input type="radio" name="pwdsel" value="normal"
    > disabled></td>
    > <td nowrap>Normal</td>
    > <td align="center"><input type="radio" name="pwdsel" value="date"
    > checked disabled></td>


    Shows checked for me

    > Any ideas as to what I am doing wrong?


    Not suppling a URL to the actual page in question.


    Maybe your browser cached an older version...



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Aug 22, 2008
    #2
    1. Advertising

  3. Daniel Rudy

    Ari Heino Guest

    I think the problem is that multiple inputs have name="pwdsel". If you
    remove/change them you'll see both work.


    --
    Ari
    http://users.utu.fi/athein/
     
    Ari Heino, Aug 22, 2008
    #3
  4. Ari Heino wrote:
    > I think the problem is that multiple inputs have name="pwdsel". If you
    > remove/change them you'll see both work.


    For radio buttons, you're *supposed* to have multiple inputs with the
    same name. That's what causes only one of them to be checked at a given
    time (that is, what causes the checked one to become unchecked when the
    user clicks another one).
     
    Harlan Messinger, Aug 22, 2008
    #4
  5. Daniel Rudy

    Daniel Rudy Guest

    At about the time of 8/22/2008 10:58 AM, Jonathan N. Little stated the
    following:
    > Daniel Rudy wrote:
    >> What is the difference between these two code fragments?
    >>
    >>
    >> This one does not work. The radio button with the checked attribute is
    >> not checked at all.
    >>
    >> <table>
    >> <tbody>
    >> <tr>
    >> <td align="center"><input type="radio" name="pwdsel" value="never"
    >> disabled></td>
    >> <td nowrap>Never</td>
    >> <td align="center"><input type="radio" name="pwdsel" value="nextlogin"
    >> disabled></td>
    >> <td nowrap>Next Login</td>
    >> <td align="center"><input type="radio" name="pwdsel" value="normal"
    >> disabled></td>
    >> <td nowrap>Normal</td>
    >> <td align="center"><input type="radio" name="pwdsel" value="date"
    >> checked disabled></td>

    >
    > Shows checked for me
    >


    What browser are you using?

    >> Any ideas as to what I am doing wrong?

    >
    > Not suppling a URL to the actual page in question.
    >


    That is not possible. This is on an internal development server that
    cannot be accessed from the Internet.

    > Maybe your browser cached an older version...
    >


    That's what I thought too, but that code is from the Show Source command
    in Seamonkey.


    --
    Daniel Rudy

    Email address has been base64 encoded to reduce spam
    Decode email address using b64decode or uudecode -m
     
    Daniel Rudy, Aug 23, 2008
    #5
  6. Daniel Rudy wrote:

    > What browser are you using?


    How about you?

    >>> Any ideas as to what I am doing wrong?

    >>
    >> Not suppling a URL to the actual page in question.

    >
    > That is not possible. This is on an internal development server that
    > cannot be accessed from the Internet.


    Bullshit. If you want others to help you for free, the least you can do is
    to upload a demo page for the problem, if you cannot reveal the real page.

    Is the problem that <input type="radio" checked disabled> does not look like
    checked? Then _you_ specify the browser(s) in which this happens (and a URL
    of a demo).

    Or should we guess that your page is somewhere on the spamthis.net domain
    since your From field specifies that you are reachable there?

    --
    Yucca
    Please quote this signature to show your cluelessness.
     
    Jukka K. Korpela, Aug 23, 2008
    #6
    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. yurps
    Replies:
    1
    Views:
    6,901
    rajeshthangarasu1983
    Feb 29, 2008
  2. Dave Smithz
    Replies:
    17
    Views:
    982
  3. Stefan Mueller
    Replies:
    5
    Views:
    12,409
    jamesxa
    Jun 16, 2009
  4. Phil Powell

    Radio buttons do not appear checked

    Phil Powell, Sep 30, 2003, in forum: Javascript
    Replies:
    22
    Views:
    212
    Lasse Reichstein Nielsen
    Oct 2, 2003
  5. Bob

    radio checked or not

    Bob, Jul 26, 2007, in forum: Javascript
    Replies:
    4
    Views:
    84
    Evertjan.
    Jul 26, 2007
Loading...

Share This Page