Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Problems with State field on registration form

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-21-2005, 10:32 AM
  frankdux's Avatar 
frankdux frankdux is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Manchester, NH, USA
Posts: 125
 

Default Problems with State field on registration form

I am running into a problem with the "State" field on the registration form when users have JavaScript disabled. If a user has JavaScript turned off in their browser they cannot see this field at all and thus they cannot enter anything. The end result is that whatever your default state is set to is what shows up as the state in the order confirmation email. The order may going to a zip code in Oregon but it will show New York as the state.

Now someone's first response might be to say that the user can click on the "If Javascript is disabled in your browser click here" link. The problem is, a lot of people have no idea what JavaScript is so they don't know to use that link.

Here is a screenshot that shows the state field missing:
http://www.zaptank.com/temp/js_missing_state.jpg

Has anyone else bumped into this problem and come up with a good way to handle it?
__________________
X-Cart: 4.0.18
Linux, Apache, MySQL: 4.1.16, PHP: 4.4.2
Reply With Quote
  #2  
Old 06-21-2005, 12:40 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

You could just turn of the Javascript generated state list and have them enter their state manually.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 06-22-2005, 06:38 AM
  frankdux's Avatar 
frankdux frankdux is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Manchester, NH, USA
Posts: 125
 

Default

Quote:
Originally Posted by balinor
You could just turn of the Javascript generated state list and have them enter their state manually.

I considered that, but I thought it would cause problems because people would enter the state inconsistently. For example Florida could be entered as FL, FLA or Florida. I might be wrong, but I was worried that my payment gateway(VeriSign Payflow Pro) or FedEx might choke on that. Actually with FedEx it's just going by the zip so I guess my only concern is with the payment gateway.
__________________
X-Cart: 4.0.18
Linux, Apache, MySQL: 4.1.16, PHP: 4.4.2
Reply With Quote
  #4  
Old 06-28-2005, 12:30 PM
  frankdux's Avatar 
frankdux frankdux is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Manchester, NH, USA
Posts: 125
 

Default

Well I am starting to think this problem has a different origination than users having Javascript turned off. Based on some testing I've been doing, I am starting to think my customers are just forgetting to choose a state and leaving the default state. What might help with this is a choice at the top of the Select Form saying "Select A State." I am normally pretty capable of customizing X-cart, but because the state list is generated dynamically I cannot figure out a way to insert something like. Anyone ever do something like this or have any idea how to do it? If I didn't explain this clearly, here is a screenshot of what I am trying to do:

http://www.zaptank.com/temp/select_a_state.jpg
__________________
X-Cart: 4.0.18
Linux, Apache, MySQL: 4.1.16, PHP: 4.4.2
Reply With Quote
  #5  
Old 07-05-2005, 09:52 AM
  frankdux's Avatar 
frankdux frankdux is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Manchester, NH, USA
Posts: 125
 

Default

Ok, with the help of X-cart support, I was able to to find a way to insert "Select A State" at the top of the State form. This prevents people from just leaving the default state chosen. The default now is "Select A State" and they will get an error now if they don't choose anything. I am posting the modification here for anyone else who may want to use it.

1. Open '<xcart_root_dir>/skin1/change_states_js.tpl' template.

2. Make a backup copy of '<xcart_root_dir>/skin1/change_states_js.tpl' in case this change breaks something. I did this on a store using X-Cart 4.0.11.

3. Replace :
Code:
for(x = 0; x < _states.length; x++) { s_obj.options[s_obj.length] = new Option(states[_states[x]][2], states[_states[x]][1]); s_obj.options[s_obj.length-1].selected = (default_value == states[_states[x]][1]); }

with:
Code:
s_obj.options[s_obj.length] = new Option("Select A State", ""); s_obj.options[s_obj.length-1].selected = true; for(x = 0; x < _states.length; x++) { s_obj.options[s_obj.length] = new Option(states[_states[x]][2], states[_states[x]][1]); {/literal} {if $login ne ""} s_obj.options[s_obj.length-1].selected = (default_value == states[_states[x]][1]); {/if} {literal} }
__________________
X-Cart: 4.0.18
Linux, Apache, MySQL: 4.1.16, PHP: 4.4.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:23 AM.

   

 
X-Cart forums © 2001-2020