473,614 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "totalStrin g" input box and
alert.
Thanks for any help,
Louis
-------------------------------------------------
<script type="text/javascript">
function upperCase()
{
var x=document.getE lementById("fna me").value;
document.getEle mentById("fname ").value=x.toUp perCase();
//var b="used cars";
//alert(x);
}
function numFlag()
{
var y=document.getE lementById("num ber").value;
document.getEle mentById("total String").value= "hello"+y;
alert(y);
//document.write y;
}
</script>
<form>
Enter your name: <input type="text" id="fname"
onBlur="upperCa se()"><br />
Enter your age: <input type="text" id="age" onBlur="alert(t his.id)">
<br><br>
<select name="test" id="number" onChange="numFl ag()" size="1">
<option>1</option>
<option>2</option>
<option>3</option>
</select<!---->

<br>
<br><br>
<input name="totalStri ng" id="totalString "></form>
Aug 21 '08 #1
3 60123
"ll" <ba**********@y ahoo.comwrote in message
news:82******** *************** ***********@m3g 2000hsc.googleg roups.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 "totalStrin g" input box and
alert.
Thanks for any help,
Louis
-------------------------------------------------
<script type="text/javascript">
function upperCase()
{
var x=document.getE lementById("fna me").value;
document.getEle mentById("fname ").value=x.toUp perCase();
//var b="used cars";
//alert(x);
}
function numFlag()
{
var y=document.getE lementById("num ber").value;
document.getEle mentById("total String").value= "hello"+y;
alert(y);
//document.write y;
}
</script>
<form>
Enter your name: <input type="text" id="fname"
onBlur="upperCa se()"><br />
Enter your age: <input type="text" id="age" onBlur="alert(t his.id)">
<br><br>
<select name="test" id="number" onChange="numFl ag()" 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="totalStri ng" id="totalString "></form>


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

news:82******** *************** ***********@m3g 2000hsc.googleg roups.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 "totalStrin g" input box and
alert.
Thanks for any help,
Louis
-------------------------------------------------
<script type="text/javascript">
function upperCase()
{
var x=document.getE lementById("fna me").value;
document.getEle mentById("fname ").value=x.toUp perCase();
//var b="used cars";
//alert(x);
}
function numFlag()
{
var y=document.getE lementById("num ber").value;
document.getEle mentById("total String").value= "hello"+y;
alert(y);
//document.write y;
}
</script>
<form>
Enter your name: <input type="text" id="fname"
onBlur="upperCa se()"><br />
Enter your age: <input type="text" id="age" onBlur="alert(t his.id)">
<br><br>
<select name="test" id="number" onChange="numFl ag()" 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="totalStri ng" id="totalString "></form>

** Posted fromhttp://www.teranews.co m**


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...@y ahoo.comwrote:
On Aug 21, 7:20 pm, "GArlington " <garling...@tis cali.co.ukwrote :
"ll" <barn104_1...@y ahoo.comwrote in message
news:82******** *************** ***********@m3g 2000hsc.googleg roups.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 "totalStrin g" input box and
alert.
Thanks for any help,
Louis
-------------------------------------------------
<script type="text/javascript">
function upperCase()
{
var x=document.getE lementById("fna me").value;
document.getEle mentById("fname ").value=x.toUp perCase();
//var b="used cars";
//alert(x);
}
function numFlag()
{
var y=document.getE lementById("num ber").value;
document.getEle mentById("total String").value= "hello"+y;
alert(y);
//document.write y;
}
</script>
<form>
Enter your name: <input type="text" id="fname"
onBlur="upperCa se()"><br />
Enter your age: <input type="text" id="age" onBlur="alert(t his.id)">
<br><br>
<select name="test" id="number" onChange="numFl ag()" 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="totalStri ng" id="totalString "></form>
** Posted fromhttp://www.teranews.co m**

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
9911
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 variable> Thanks, Jeff
1
1715
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 calling an function fun1() which is in another dll, MYDll.dll(which is linked implicitly to the exe) which includes the same header file header.h
3
2532
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 so that i can browse to diff URL each time i click the button. Hope you understand the scenario. So here my question is how long is the value of the static variable retained from the time i click on the button, because what i observe is when the...
5
2855
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 reverts back to its original value, the one I had set it before in the previous trip sortcommand event handler. I am trying to implement bidirectional sorting on a datagrid by making use of session variable Session("SDirection"). In the sortcommand...
0
1251
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 then that progress bar should start and it should stop when the variable that I am passing in the javascript becomes greater than 1. That variable value starts with zero and it increases after making a call to another function called func.
0
2278
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), inside the Session_Start event of the global.asax.vb file, since this variable is accessed by almost all the pages in the project. Besides this variable, there are other session variables which are set in the various aspx pages, as needed.
1
3401
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 change the value of variable "val" to 5; so can i in anyway get the value of variable "val" equal to 5? after loading the page..,i mean after onload() event is done/ does my question make any sense? thnx..
12
2088
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 of which module the call is made from? Example:
3
3090
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 equals but only the expresion formula itself. What am I doing wrong here? Thanks in advance!
0
8197
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8142
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8589
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8287
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8443
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7114
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4136
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2573
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.