Well I feel like an idiot, because its simple and I cant get it to work  I am a jscript newb..... I have a form with billing and shipping addresses. If they choose a country other than USA then it replaces the billing state field with the billing alternate state field. I then try to check that in the jscript function I created to copy the billing address to shipping address if they click the copy address function.
Below you see the bstate_value code which is obviously wrong, the odd thing is... it will copy the alternate state values when I have it like this. Syntactical error I caught... Anyways if I fix that to be f.bstate.value || etc it will for the bstate but not alt state.
If this is confusing I can put in the code that I think should work but is not.
form fields are
bstate, sstate, balt_state, salt_state
Code:
function cbilling(f) {
if(f.usebilling.checked == true) {
f.saddr1.value = f.baddr1.value;
f.scity.value = f.bcity.value;
f.szipc.value = f.bzipc.value;
if (!f.bstate_value || 0 === f.bstate_value.length){
f.salt_state.value = f.balt_state.value;
} else {
f.sstate.value = f.bstate.value;
}
}
}
thanks in advance
|