Re: Validating Radio Buttons in two directions

From: Date: Fri, 20 Jan 2006 00:26:20 +0000
Subject: Re: Validating Radio Buttons in two directions
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-228904@lists.php.net to get a copy of this message
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. VALID INPUTS: -------- Red: 1 Green: 3 Blue: 2 -------- Red: 1 -------- INVALID INPUTS: -------- 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? http://l-i-e.com/artists.htm

« previous php.general (#228904) next »