Re: Valor de campo entrada text

From: Date: Fri, 19 Jul 2002 17:37:31 +0000
Subject: Re: Valor de campo entrada text
References: 1 2 3 4 5  Groups: php.general.es 
Request: Send a blank email to general-es+get-25093@lists.php.net to get a copy of this message
modifique un par de cosas porque daba errores de sintaxis el ) del if y el ; va al final del echo, dentro del }. quedo de esta forma: <select size="1" name="Programa"> <option value="00" <?php if($myrow["programa"]= '0') {echo 'selected';} ?>>*</option> <option value="01" <?php if($myrow["programa"]= '1') {echo 'selected';} ?>>PCN</option> <option value="02" <?php if($myrow["programa"]= '2') {echo 'selected';} ?>>PEE</option> <option value="03" <?php if($myrow["programa"]= '3') {echo 'selected';} ?>>UNUA</option> </select> pero no funca simpre muestra como selected el ultimo valor en nuestro ejemplo UNUA, sin importar que valor tenga programa $myrow["programa"]. Tiene que haber alguna forma de resolver esto. ----- Original Message ----- From: "Julio Herrera - Directo" <juliohv@directo.cl> To: <lista@phpes.com> Sent: Friday, July 19, 2002 1:07 PM Subject: Re: [PHP-ES] Valor de campo entrada text > Disculpa pero value no va dentro del tag de Select, pero ese no es tu > problema, a ver si te puedo ayudar: > > <select name="Programa" > > <option value="00" <?php if($myrow["programa"]='00' > {echo > 'selected'};?>>Uno</option> > <option value="01" <?php if($myrow["programa"]='01' > {echo > 'selected'};?>>PCN</option> > <option value="02"<?php if($myrow["programa"]='02' > {echo > 'selected'};?>>PEE</option> > <option value="03" <?php if($myrow["programa"]='03' > {echo > 'selected'};?>>UNUA</option> > </select> > > Si estoy errado por favor diganme. > > Julio > > > ----- Original Message ----- > From: "Federico Coco" <fcoco@cilsa.org.ar> > To: <lista@phpes.com> > Sent: Friday, July 19, 2002 11:36 AM > Subject: Re: [PHP-ES] Valor de campo entrada text > > > > Esto en lo que dice el manual: > > > > Zero or more choices may be pre-selected for the user. User agents should > > determine which choices are pre-selected as follows: > > > > If no OPTION element has the selected attribute set, no options should be > > pre-selected. > > If one OPTION element has the selected attribute set, it should be > > pre-selected. > > If the SELECT element has the multiple attribute set and more than one > > OPTION element has the selected attribute set, they should all be > > pre-selected. > > It is considered an error if more than one OPTION element has the selected > > attribute set and the SELECT element does not have the multiple attribute > > set. User agents may vary in how they handle this error, but should not > > pre-select more than one choice. > > > > <select size="1" name="Programa" value="<?php echo > > $myrow["programa"] > ?>"> > > <option value="00" selected>*</option> > > <option value="01">PCN</option> > > <option value="02">PEE</option> > > <option value="03" >UNUA</option> > > </select> > > > > El atributo selected se usa dentro de las option, no se como cambiarlo en > > forma dinamica en funcion del valor que tenga $myrow["programa"]? > > > > > > ----- Original Message ----- > > From: "Andres Ferrando" <anferr@mecon.gov.ar> > > To: <lista@phpes.com> > > Sent: Friday, July 19, 2002 11:35 AM > > Subject: Re: [PHP-ES] Valor de campo entrada text > > > > > > mirá el atributo "selected". > > y, de paso, leé un manual de html! > > > > > seria una cosa asi > > > > > > value="<?php if (isset($myrow["anio"])) {echo > > > $myrow["anio"]} > > > else {echo 2002} ?>" > > > > > > en el caso de un tipo select como se hace, porque poniendo el value como > > en > > > los text, no me da pelota? > > > > > > ----- Original Message ----- > > > From: "Andres Ferrando" <anferr@mecon.gov.ar> > > > To: <lista@phpes.com> > > > Sent: Friday, July 19, 2002 11:15 AM > > > Subject: Re: [PHP-ES] Valor de campo entrada text > > > > > > > > > > si tiene un valor $myrow["anio"] lo imprimis, y si no lo tiene, > imprimis > > > > "2002" ... > > > > > > > > > la pregunta es como hago para que cuando estoy actualizando > > > > > value="<?php echo $myrow["anio"] ?>" > > > > > y cuando estoy en modo alta > > > > > value="2002" > > > > -- > > Andres Ferrando <anferr@mecon.gov.ar> > > > > > > --------------------------------------------------------------------- > > Archivo On-line: http://www.phpes.com/ > > via news: news://news.phpes.com/ > > Manual PHP en español: http://www.php.net/manual/es/ > > Para dar de baja la suscripción, mande un mensaje a: > > lista-unsubscribe@phpes.com > > > > > > > > --------------------------------------------------------------------- > > Archivo On-line: http://www.phpes.com/ > > via news: news://news.phpes.com/ > > Manual PHP en español: http://www.php.net/manual/es/ > > Para dar de baja la suscripción, mande un mensaje a: > > lista-unsubscribe@phpes.com > > > --------------------------------------------------------------------- > Archivo On-line: http://www.phpes.com/ > via news: news://news.phpes.com/ > Manual PHP en español: http://www.php.net/manual/es/ > Para dar de baja la suscripción, mande un mensaje a: > lista-unsubscribe@phpes.com >

« previous php.general.es (#25093) next »