Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Checked option for radio type input boxes not working.

Reply
Thread Tools

Checked option for radio type input boxes not working.

 
 
Daniel Rudy
Guest
Posts: n/a
 
      08-22-2008
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
 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      08-22-2008
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
 
Reply With Quote
 
 
 
 
Ari Heino
Guest
Posts: n/a
 
      08-22-2008
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/
 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      08-22-2008
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).
 
Reply With Quote
 
Daniel Rudy
Guest
Posts: n/a
 
      08-23-2008
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
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      08-23-2008
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.

 
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
Line in connector input not working? disabled? input radio to computer. 8ball meme Computer Support 7 11-18-2010 10:39 PM
Space between input boxes and selection boxes is not the same in Internet Explorer Stefan Mueller HTML 5 06-16-2009 02:06 PM
CheckBox Checked=false when checked in DataList yurps ASP .Net 1 02-29-2008 01:08 PM
radio checked or not Bob Javascript 4 07-26-2007 01:06 PM
Radio buttons do not appear checked Phil Powell Javascript 22 10-02-2003 02:06 AM



Advertisments