
January 7th, 2013, 10:41 AM
|
|
Registered User
|
|
Join Date: Aug 2008
Posts: 17
Time spent in forums: 52 m 19 sec
Reputation Power: 0
|
|
|
PHP option selection help
Hello,
I tried to create a drop-down for users to pick. If a user pick 'United States', then Us States will show up. Otherwise, 'Outside usa' will show.
It didn't work. Here is my code:
dt>Country</dt>
<dd>
<select class="select" id="field_country" name="country">
<option value="1" selected="selected">United States</option>
<option value="2">Canada</option><option value="3">Afghanistan</option>
</select>
</dd>
<?php if (field_country) == "1") { ?>
<dt>State</dt>
<dd>
<select class="select" id="field_state" name="state">
<option value="1">Alabama</option>
<option value="2">Alaska</option>
<option value="3">Arizona</option>
<option value="5" selected="selected">California</option>
</select>
</dd>
<?php } else { ?>
<dt>State</dt>
<dd>
<select class="select" id="field_state" name="state">
<option value="6" selected="selected">Outside Usa</option>
</select>
</dd>
<?php } ?>
Thanks.
|