Re: Re: checkboxes

From: Date: Wed, 22 Apr 2009 05:58:53 +0000
Subject: Re: Re: checkboxes
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-291799@lists.php.net to get a copy of this message
PJ wrote: > Ashley Sheridan wrote: > >> On Wed, 2009-04-22 at 07:17 +0530, kranthi wrote: >> >>> yeh an onclick event handler is required to achieve this. but as Shawn >>> has suggested radio buttons are better in this case. >>> >>> but then again if u want to disable/greyout the other input(like >>> textboxes, other than the radio button itself) u'll hav to use onclick >>> event handler for the radio buttons >>> >>> >> Not necessarily, you could use CSS to change the background colour: >> >> input[checked=checked] >> { >> set styles here >> } >> > I see that Shawn's suggested radio buttons will do just fine. I hadn't > thought about that. Dummy me. > But the real problem I have is to pass a form input value to a variable. > For example: > <input type="text" name="titleIN" size="52" /> > <input type="radio" name="choice" value="$titleIN" /> > How can I pass the "text" input to a variable that could be used by the > "radio" button? > The idea is to have several inputs for a search page with the inputs > limited by the radio button to one choice of several inputs. If I can > get the input to a variable, I can then manipulate it to do a query for > the search. :-\ > Hope this is understandable? Here's something I found but don't understand if or how it could be used: (from php.net manual) |quote... snip... to reliably allow form data to be fed back into a form (for editing a record, for instance) is like this: echo "<input type='text' name='varname' "; if(isset($existingvalue)) echo "value=\"".htmlspecialchars(stripslashes($existingvalue))."\" "; echo "/>"; This assumes that variables have been escaped (such as addslashes) after being retrieved from the database or after being received from a (probably this) form. endquote From this form??? How would you get the $existingvalue? from the form? How? I'm trying, I'm trying... Phil | -- unheralded genius: "A clean desk is the sign of a dull mind. " ------------------------------------------------------------- Phil Jourdan --- pj@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php

« previous php.general (#291799) next »