Re: Save SELECT field value

From: Date: Tue, 29 Apr 2003 13:18:17 +0000
Subject: Re: Save SELECT field value
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-145642@lists.php.net to get a copy of this message
when you are outputing the <option> tags, check if the value is equal to the value user has choosed: while( get a country ) { echo "<option value='$country_id'". ( $country_id == $prev_user_choise ? ' selected' : '')."> $country_name </option>\n"; } John M. wrote:
Hello, I have a select field on my site. The user fills the my form and go to an other site to check it. But if user want to go back to correct some items how can I set the select field to what user chosed before. I mean if the user select a country and write an email and after he wants to correct only the email he shouldn't choose the country again. The values of the select field are not the same as the displayed text. I mean 'German' will be display, but the value of German is 'D'; Is it possible? Thanks!


« previous php.general (#145642) next »