Reply to Re: [PHP] Validating Radio Buttons in two directions

Your name:


Posted by "Richard Lynch" on 01/20/06 02:26

On Tue, January 17, 2006 9:45 am, John Nichel wrote:
> Huh? Maybe I'm just not awake this morning and not understanding what
> you're trying to explain, but if you're using *radio* buttons, only
> *one* of the same name can be checked at any give time. ie:
> <input type="radio" name="color" value="1" /> Blue
> <input type="radio" name="color" value="2" /> Red
> <input type="radio" name="color" value="3" /> Black
> <input type="radio" name="color" value="4" /> Green
> <input type="radio" name="color" value="5" /> Mauve
> If you click "Red" and "Blue" is already selected, "Blue" will
> automatically be unselected. It's basic HTML.

He has:
v v v v v
Red: 1 2 3 4 5
Green: 1 2 3 4 5
Blue: 1 2 3 4 5

Only one (1) Red may be checked, by radio button rules.

In addition, he needs to constrain that at most one (1) of each digit
may be checked, and therein lies the rub.

Red: 1
Green: 3
Blue: 2
Red: 1

Red: 1
Red: 2
Red: 1
Green: 1

Radio buttons can avoid either of the two above invalid inputs.

They cannot cover both.

He has chosen to cover the first one with Radio Buttons.

The second constraint will then require Javascript (or other
client-side logic) and PHP application logic (since client-side can be
bypassed by user).

Like Music?

[Back to original message]

Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация