473,324 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

setting getElementById().value equal to variable value

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.toUpperCa se();
//var b="used cars";
//alert(x);
}
function numFlag()
{
var y=document.getElementById("number").value;
document.getElementById("totalString").value="hell o"+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>
Aug 21 '08 #1
3 60114
"ll" <ba**********@yahoo.comwrote in message
news:82**********************************@m3g2000h sc.googlegroups.com...
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.toUpperCa se();
//var b="used cars";
//alert(x);
}
function numFlag()
{
var y=document.getElementById("number").value;
document.getElementById("totalString").value="hell o"+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<!---->
You might want to give the options above separate values...
<option value ="1">1</option>
>
<br>
<br><br>
<input name="totalString" id="totalString"></form>


** Posted from http://www.teranews.com **
Aug 22 '08 #2
ll
On Aug 21, 7:20 pm, "GArlington" <garling...@tiscali.co.ukwrote:
"ll" <barn104_1...@yahoo.comwrote in message

news:82**********************************@m3g2000h sc.googlegroups.com...
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.toUpperCa se();
//var b="used cars";
//alert(x);
}
function numFlag()
{
var y=document.getElementById("number").value;
document.getElementById("totalString").value="hell o"+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<!---->

You might want to give the options above separate values...
<option value ="1">1</option>
<br>
<br><br>
<input name="totalString" id="totalString"></form>

** Posted fromhttp://www.teranews.com**


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
Aug 22 '08 #3
On Aug 22, 3:50 pm, ll <barn104_1...@yahoo.comwrote:
On Aug 21, 7:20 pm, "GArlington" <garling...@tiscali.co.ukwrote:
"ll" <barn104_1...@yahoo.comwrote in message
news:82**********************************@m3g2000h sc.googlegroups.com...
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.toUpperCa se();
//var b="used cars";
//alert(x);
}
function numFlag()
{
var y=document.getElementById("number").value;
document.getElementById("totalString").value="hell o"+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<!---->
You might want to give the options above separate values...
<option value ="1">1</option>
<br>
<br><br>
<input name="totalString" id="totalString"></form>
** Posted fromhttp://www.teranews.com**

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
http://www.w3schools.com/jsref/default.asp
Aug 22 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: JeffFinnan | last post by:
Is there a way to have a text input field equal some variable value so that it changes if that variable changes? It does not have to by dynamic. <INPUT TYPE="TEXT" NAME="hW" size="4" value=some...
1
by: Varadha | last post by:
Hi, I am declaring a variable static char Version_No = '1' in header file header.h In a application "app.exe", i am changing the value of the variable in to '2' In the same application i am...
3
by: Helpseeker | last post by:
Hi all, I have written a small code in which i declare a static int variable and increment its value by one each time i click on a button. actually i use the int variable value in a particular URL...
5
by: aamirghanchi | last post by:
Hi, I need to know if anyone else came across this. The Session variable value I set in a sortCommand event handler of a datagrid does not hold on till the next sortcommand event handler and...
0
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I want to display a progress bar on my web page. I have this code for progress bar in javascript in my web page. I have a button on the web page, if someone clicks that button...
0
by: tharika_c | last post by:
Hi, We have a simple ASP.NET web application where one of the Session variables, called Session("SSO_ID") gets created and assigned a value (equal to the HTTP_HRID request variable value),...
1
by: pendem | last post by:
I mean can set a variable value in a script to be unchanged even after page reload? for example if i set a value of a global variable "val" to 2 ; so using onbeforeunload() or onunload(), i will...
12
by: Slaunger | last post by:
Hi, I am new here and relatively new to Python, so be gentle: Is there a recommended generic implementation of __repr__ for objects equal by value to assure that eval(repr(x)) == x independet...
3
by: bknabl | last post by:
I tried setting up a new combo box to have todays date as a user choice by setting its property to a value list. Then for the row source it set it to =Date(). Access will not show what the expression...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.