[Javascript] problem of only one radio button

Rodney Myers rodney at aflyingstart.net
Fri Jul 20 09:01:45 CDT 2001


> Is it true that radio button will function correctly only at least two of them
exist in form ?
YES

> Is it true that checkbox will function correctly only at least two of them
exist in form ?
NO, One checkbox is OK

I advise that server side you make a count of the rows found.
If only one you write a checkbox, and appropriate script
If 2 or more write radio buttons.

The radio buttons array length returns an error if there is only one RB.

hth

Rodney


Abraham Liu wrote:

> Hi,
> In my jsp program, I select a number of rows from database table, then
> display them in form table. Each row attachs a radio button, So users can
> select one of rows and do further process.
> The reason I use radio button is that I concatenate 3 table columns and
> store them in "value" property of button. When user click button, I use
> javascript "split" function to get these 3 columns back. Everything seemed
> working just fine. But I realized that if only one row got selected which
> meaned only one button exists also, then the fuction of radio button didn't
> worked and "split" won't work either. I switched to checkbox, I got the same
> result.
>
> Is it true that radio button and checkbox will function correctly only at
> least two of them exist in form ?
> In my case, the number of radio button are genarated dynamically depending
> on the number rows being selected. So what can I do ? Do I have some other
> alternative ways ?
> I will be appreciated some kindly help.
> Thank you.
> Abe Liu
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript

--
Shop at ssistant Add-ons and Developer Workshops
http://www.aflyingstart.net/addons/

Enquiries regarding Shop at ssistant Classic training :
Call 01256 880770

Rodney Myers
Based in Oxford, England
Technical Director, Shop at ssistant eCommerce Solutions





More information about the Javascript mailing list