PDA

View Full Version : heres a hack for bill country bug


dreamingdigital
09-11-06, 07:38 PM
Use it if you want. I just wrote this little Javascript. Put it in your ShipZip code. I moved the Country before the ZIP and the phone and emails after the country. I also put this code in the phone for redundancy.


<input type="text" name="ShipZip" size="20" onFocus="this.form.BillCountry.options.selectedIndex=this.f orm.ShipCountry.options.selectedIndex;" value="&mvte:global:ShipZip;">

Of course you may want to add some conditionals in there. I took them out to be generic for this post.

I also have all my ship to fields auto-fill the bill-to fields. I'm not saying this is the right way but it does get around the country annoyance a little.

Kent Multer
09-11-06, 07:56 PM
Have you tested this with Internet Explorer? I've had trouble in the past with JavaScript that used the "this" keyword; my impression was that it doesn't work in IE.

Thanks --

dreamingdigital
09-11-06, 08:15 PM
Works in IE6. I'm guessing IE5.5+. MAYBE on ieMac but that's been discontinued since 2003 and it's a piece... IE4 nope. NS4 I dunno. The admin decision was made to make our new web site dom browser only (ie: document.getElementById() only) don't respond about that.

But anywho, it's easy not to use this.form.element -- just give the form a name and you can use document.forms['formname'].element or if you're too lazy to do that you could use document.forms[0].element if you only have 1 form on your page

Brandon MUS
09-12-06, 01:01 AM
That still doesn't fix the bug for returning customers. In my opinion, that's where the bug is the most annoying.

Now, you might be able to fix it by putting that same kind of code in the body onload tag.