kopykakemg Posted June 17, 2013 Share Posted June 17, 2013 Hello All,Not sure if this is the right place but here's what I would like to do. I have a very simple contact us page for our company in our XCART. Today I got the request to change a few things but I'm not really a huge PHP developer (I code in C#). So my question is the following, when my users are filling out the form it also asks for country. If the country is NOT Equal to US (United States) then just show the country from the drop down list. But IF the country eq 'US' then I want the State Drop-down to show. How could I make this Happen? It appears that I need to somehow combine theses two methods together with a If/Else if?? Below is the actual code un-touched:{if $default_fields.b_country.avail eq 'Y'}<tr><td class="data-name"><label for="b_country">{$lng.lbl_country}</label></td><td{if $default_fields.b_country.required eq 'Y'} class="data-required">*{else}> {/if}</td><td><select id="b_country" name="b_country" onchange="javascript: check_zip_code_field(this, $('#b_zipcode'));">{foreach from=$countries item=c}<option value="{$c.country_code}"{if ($userinfo.b_country eq $c.country_code) or ($c.country_code eq $config.General.default_country and $userinfo.b_country eq "")} selected="selected"{/if}>{$c.country}</option>{/foreach}</select></td></tr>{/if}{if $default_fields.b_state.avail eq 'Y'}<tr><td class="data-name"><label for="b_state">{$lng.lbl_state}</label></td><td{if $default_fields.b_state.required eq 'Y'} class="data-required">*{else}> {/if}</td><td>{include file="main/states.tpl" states=$states name="b_state" default=$userinfo.b_state|default:$config.General. default_state default_country=$userinfo.b_country|default:$confi g.General.default_country country_name="b_country"}</td></tr>{/if}Thank you in advance,~Mario Quote Link to comment https://forums.phpfreaks.com/topic/279282-php-contact-us-code-~-help/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.