Click to See Complete Forum and Search --> : reassign form values onsubmit (IE5 Mac)


oliveto
07-02-2003, 12:10 PM
I've got a form that works great on all my needed browsers except IE 5 for MAC. I'd like it to work there as well.

The following code is executed upon form submission.

function concatPhones()
{
document.register.numbOffice_phone.value = ([document.register.numbOffice_phone.value] + [document.register.xOffice_Phone2.value] + [document.register.xOffice_Phone3.value]);
document.register.numbMobile_Phone.value = ([document.register.numbMobile_Phone.value] + [document.register.xMobile_Phone2.value] + [document.register.xMobile_Phone3.value]);
document.register.numbFax.value = ([document.register.numbFax.value] + [document.register.xFax2.value] + [document.register.xFax3.value]);
}

The form submits fine with no javascript errors that are visible, however the statements are not executed. How can I detect ie5/Mac and then reference these values for that browser?

Thanks for any help.

Jona
07-02-2003, 03:22 PM
Try taking off the brackets and parenthesis. They aren't necessary, if I'm correct, the code should work fine without them.

[J]ona

oliveto
07-02-2003, 03:32 PM
Thanks for the input. Looks like I was chasing a ghost. I thought it was a Mac/IE5/javascript issue. Turns out my users just had javascript turned off and so it never ran. Thanks again anyways.

Jona
07-02-2003, 03:33 PM
Originally posted by oliveto
Thanks for the input. Looks like I was chasing a ghost. I thought it was a Mac/IE5/javascript issue. Turns out my users just had javascript turned off and so it never ran. Thanks again anyways.

LOL! :D All right.

[J]ona

Charles
07-02-2003, 06:38 PM
1) Always make sure that your site works without the JavaScript.

2) Yes, your script will work with or without those brackets, but the brackets maket the browser do a lot of extra work. The way you are using them, they indicate Array literals, each with one element. When you use the additive operator, "+", the browser has to call the method Array.toString() for each operand.