I'm stumped. I'm not so sure what is the answer. I'll do some research and get back to you if I bump into an decent answer. You should email the people at iPage as they probably can help you..
There is a contribution for doing just this thing. you can also look in the knowledge base, there are some things in there relevant too...
I have looked everywhere for days.
Searched for:.
State, drop down, box, create account, account_create.
NOTHING..
If you have any links I would really appreciate it.
Also I went to the page where the error box will show. Changed it to read EXACTLY the way the country box does and it still doesn't work...
Mibble, I found the Country-State Selector contribution. It seemed what I was looking for. However, I have installed it and I still have the same problem..
If I go to establish an new customer account, the state field is a text box, not a drop down box. The "United States" is already selected as the country by default. If I simply enter a two-letter state abreviation (as I believe most people will do), an error is generated stating that I should select a state for the drop down box (that wasn't there before)..
Is there a way to have the state drop down box appear when the page is initially loaded if the United States is the only country and the default country?..
I have so many contribs installed that I am not sure if this was it or not but here is what I did: BACK UP BACK UP BACK UP BACK UP FIRST FIRST (just in case you weren't sure, you should backup first). And good luck..
Craig.
Find the following on or about line 411(unchanged create_account.php file).
******************************************************************.
<?php.
If (ACCOUNT_STATE == 'true') {.
?>.
<tr>.
<td class="main"><?php echo ENTRY_STATE; ?></td>.
<td class="main">.
<?php.
If ($process == true) {.
If ($entry_state_has_zones == true) {.
$zones_array = array();.
$zones_query = tep_db_query("select zone_name from "TABLE_ZONES" where zone_country_id = '"(int)$country"' order by zone_name");.
While ($zones_values = tep_db_fetch_array($zones_query)) {.
$zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);.
}.
Echo tep_draw_pull_down_menu('state', $zones_array);.
} else {.
Echo tep_draw_input_field('state');.
}.
} else {.
Echo tep_draw_input_field('state');.
}.
If (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">'ENTRY_STATE_TEXT;.
?>.
********************************************************************.
Replace it with this:.
<?php.
If (ACCOUNT_STATE == 'true') {.
?>.
<tr>.
<td class="main"> <?php echo ENTRY_STATE; ?></td>.
<td class="main"> .
<?php.
$zones_array[] = array('id' => '', 'text' => 'Please Select');.
$zones_query = tep_db_query("select zone_name from "TABLE_ZONES" where zone_country_id = '223' order by zone_name");.
While ($zones_values = tep_db_fetch_array($zones_query)) {.
$zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);.
}.
Echo tep_draw_pull_down_menu('state', $zones_array);.
If (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">'ENTRY_STATE_TEXT;.
?>.
*********************************************************************.
Good Luck and make sure you back up your files first...
I was reading through the forums and found another person haveing these same issues, there is another contrib. to try though I have not used it yet. Search for: country-state-selector_1_2_3_4_5.zip.
In the contribs section and givit a try..
Craig..
Blucollarguy, I couldn't find a contribution for country-state-selector_1_2_3_4_5.zip, just country-state-selector..
As I mention earlier, I installed the country-state-selector. However, it does not display the drop down box for the state field until AFTER the error message. So, bascially, I don't see what difference the country-state-selector contribution made...
If you tried the code I posted earlier and still have no luck, or if you want to keep working on the issue here is a link to another contrib, I have not used it so I cannot say if it works. Good luck all.
Http://www.oscommerc...tributions,2148..
Man do I feel dumb I didn't even see your post..
Your code works perfectly!!!.
Thanks for posting it.
*EDIT*.
I only changed one thing to fit my site:.
I delete the red text below, it makes a double space before the word "State" and throws it out of alignment with the rest of the text..
Other than that it works great!!.
This post has been edited by.
808smokey.
: 01 July 2004, 05:08..
That's great, I have been trying to figure out what was causing that extra spacing for 2 weeks! What an idiot I am! Glad it worked worked for you..
Craig..
What about adding in a break in between different countries states/provinces? Either a line or the country's name?.
I am afraid of confusing my customers...
What do you mean?.
Something like this:.
United kingdom.
United States..
Trying to apply this to address_book_process.php:.
If (ACCOUNT_STATE == 'true') {.
$country = 223;.
$entry_state_has_zones = true;.
.
// $zone_id = 0;.
//$check_query = tep_db_query("select count(*) as total from "TABLE_ZONES" where zone_country_id = '"(int)$country"'");.
// $check = tep_db_fetch_array($check_query);.
// $entry_state_has_zones = ($check['total'] > 0);.
// if ($entry_state_has_zones == true) {.
// $zone_query = tep_db_query("select distinct zone_id from "TABLE_ZONES" where zone_country_id = '"(int)$country"' and (zone_name like '"tep_db_input($state)"%' or zone_code like '%"tep_db_input($state)"%')");.
.
if ($entry_state_has_zones == true) {.
$zones_array = array();.
$zones_query = tep_db_query("select zone_name from "TABLE_ZONES" where zone_country_id = '"(int)$country"' order by zone_name");.
while ($zones_values = tep_db_fetch_array($zones_query)) {.
$zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);.
if (tep_db_num_rows($zone_query) == 1) {.
$zone = tep_db_fetch_array($zone_query);.
$zone_id = $zone['zone_id'];.
} else {.
$error = true;.
$messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT);.
}.
} else {.
if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {.
$error = true;.
$messageStack->add('create_account', ENTRY_STATE_ERROR);.
}.
}.
}.
It doesnt work...any help from php kung-fu artists?..

