setting getElementById().value equal to variable value

L

ll

I'm working with the script below which works with FF but not with IE
7. To clarify, the part of the code which isn't working in IE 7 is
putting the value of variable y in the "totalString" input box and
alert.
Thanks for any help,
Louis
-------------------------------------------------
<script type="text/javascript">
function upperCase()
{
var x=document.getElementById("fname").value;
document.getElementById("fname").value=x.toUpperCase();
//var b="used cars";
//alert(x);
}
function numFlag()
{
var y=document.getElementById("number").value;
document.getElementById("totalString").value="hello"+y;
alert(y);
//document.write y;
}
</script>


<form>
Enter your name: <input type="text" id="fname"
onBlur="upperCase()"><br />
Enter your age: <input type="text" id="age" onBlur="alert(this.id)">
<br><br>
<select name="test" id="number" onChange="numFlag()" size="1">
<option>1</option>
<option>2</option>
<option>3</option>
</select> <!---->

<br>
<br><br>
<input name="totalString" id="totalString"></form>
 
L

ll

You might want to give the options above separate values...
<option value ="1">1</option>



Works like a charm! Many thanks - is there an easy-to-reference
javascript book or site which might be of help for someone who
rarely uses it?


Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,254
Members
46,849
Latest member
Fira

Latest Threads

Top