Forum Moderators: open
onChange='parent.create.setMn(this)'
and they can't get rid of it. In looking at the coding I am wondering if instead of value="+Mn+" I should use single quotes: value='+Mn+'
Perhaps their browser is getting confused by the double quotes within double quotes?
But it's been so long since I coded it I no longer remember what the plus signs on either side of the variable Mn are for. I want to understand the code again before I go changing things.
c+="Time: ";
c+="<input type=text name=hr value="+Hr+" onChange='parent.create.setHr(this)' ";
c+="size=2 maxlength=2 class='textBox' border=1>Hour";
c+="<input type=text name=mn value="+Mn+" onChange='parent.create.setMn(this)' ";
c+="size=2 maxlength=2 class='textBox' border=1>Minutes";
I'd also appreciate your looking over the code.
Thanks, Peter
In JS you use + to concat strings, the same as adding numbers it adds strings together.
c+="<input type=text name=hr value="+Hr+" onChange='parent.create.setHr(this)' ";
This means variable called 'c' that already contains "Foo Bar!" (for example) will then contain "Foo Bar!<input type=text name=hr value=(value of Hr here) onChange='parent.create.setHr(this)' " and the rest of the INPUT box is appended on the next line.
Can't see any reason at all that a user would have an incorrect value setting, but I always single quote html parameters, so you could try changing to "type='text' name='hr'" etc....
I know it shouldn't make a difference, but on the odd occasion it might.