Strange Javascript error.
Posted: Tue Jun 13, 2006 6:08 am
I'm trying to incorporate values entered on to a form into a string before its submitted.
Here is my code:
Its part of a function which gets called whenever relevant elements on the form are changed. Subsequently in the function, other strings are added to itemname, then its written to a hidden field for submission.
Something very strange has happened. Previously it behaved quite nicely by producing something like:
"24cm x 44cm"
Now it just produces:
"in. x in."
Thing is, I have not changed anything about the form, or any code executed before this. So I can't see how this can possibly have happened.
Here is my code:
Code: Select all
if (document.orderform.measure.value==2)
itemname=document.orderform.x_dim.value+"cm x "+document.orderform.y_dim.value+"cm ";
else
itemname=document.orderform.x_dim.value+"in. x "+document.orderform.y_dim.value+"in. ";Something very strange has happened. Previously it behaved quite nicely by producing something like:
"24cm x 44cm"
Now it just produces:
"in. x in."
Thing is, I have not changed anything about the form, or any code executed before this. So I can't see how this can possibly have happened.