NuWeb.co.uk
Oct 30th 2005, 3:43 pm
Here is a SNIPPET of my codeing:
<select name="newcountry" id="newcountry">
<option <? $val="Afganistan"; echo "value=\"".$val."\""; if ($country == $val) echo "selected"; ?>Afghanistan</option>
<option <? $val="Albania"; echo "value=\"".$val."\""; if ($country == $val) echo "selected"; ?>Albania</option>
</select>
This is the HTML output:
<select id="newcountry" name="newcountry">
<option value="Afganistan" selected option Afghanistan<></option>
<option value="Albania" option Albania<></option>
</select>
Get it? .. I dont.. Well confused.
Point of this code?
This is going to be a form, which people can select their country, and submit it to a html databse. All that works. The php codeing in the form is theire to set it so, if a user sets their country to UNITED KINGDOM when they go to edit their profile, their country is still UNITED KINGDOM :)
<select name="newcountry" id="newcountry">
<option <? $val="Afganistan"; echo "value=\"".$val."\""; if ($country == $val) echo "selected"; ?>Afghanistan</option>
<option <? $val="Albania"; echo "value=\"".$val."\""; if ($country == $val) echo "selected"; ?>Albania</option>
</select>
This is the HTML output:
<select id="newcountry" name="newcountry">
<option value="Afganistan" selected option Afghanistan<></option>
<option value="Albania" option Albania<></option>
</select>
Get it? .. I dont.. Well confused.
Point of this code?
This is going to be a form, which people can select their country, and submit it to a html databse. All that works. The php codeing in the form is theire to set it so, if a user sets their country to UNITED KINGDOM when they go to edit their profile, their country is still UNITED KINGDOM :)