Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Doesnt Work in FireFox
Old 09-13-2006, 02:52 AM Doesnt Work in FireFox
boomers's Avatar
Extreme Talker

Posts: 229
Trades: 1
I have some Javascript that takes the input from some textboxes and then puts them all into a sentance automatically. It works perfectly in IE but not with FireFox... does anyone know how to make it work with both browsers?

HTML Code:
<script type="text/javascript">
function Text_Change() {
  var TxtFName = document.getElementById("TxtFName");
  var TxtSName = document.getElementById("TxtSName");
  var TxtAge = document.getElementById("TxtAge");
  var TxtLoc = document.getElementById("TxtLoc");

  var SpnDisp = document.getElementById("SpnDisp");

  var FName = TxtFName.value == "" ? "?" : TxtFName.value;
  var SName = TxtSName.value == "" ? "?" : TxtSName.value;
  var Age = TxtAge.value == "" ? "?" : TxtAge.value;
  var Loc = TxtLoc.value == "" ? "?" : TxtLoc.value;

  SpnDisp.innerHTML =
    "Hello " + FName + " " + SName + ", " +
    "you are " + Age + " years old and " +
    "at the moment you live in " + Loc;
}
</script>

<body onload="Text_Change()">

<div><input type="text" id="TxtFName" onchange="Text_Change()" /></div>
<div><input type="text" id="TxtSName" onchange="Text_Change()" /></div>
<div><input type="text" id="TxtAge" onchange="Text_Change()" /></div>
<div><input type="text" id="TxtLoc" onchange="Text_Change()" /></div>

<div><span id="SpnDisp"></span></div>
boomers is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-13-2006, 04:18 AM Re: Doesnt Work in FireFox
boomers's Avatar
Extreme Talker

Posts: 229
Trades: 1
I needed to put the fields within form tags...
boomers is offline
Reply With Quote
View Public Profile
 
Old 09-13-2006, 04:38 PM Re: Doesnt Work in FireFox
Extreme Talker

Posts: 246
Trades: 3
Was that your solution? Hope you got some talkupation for that.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
CouponGuy is offline
Reply With Quote
View Public Profile
 
Old 09-28-2006, 11:53 AM Re: Doesnt Work in FireFox
Kirtan's Avatar
Who Am I?

Posts: 377
Name: Venkat Raj
Location: Salem, South India
Trades: 3
It works fine with both IE & fire fox with out <form> tags.
I use IE 6 and Fire Fox 1.5.0.7
__________________
All the Buddhas of all the ages have been telling you a very simple fact: Be -- don't try to become.
Kirtan is offline
Reply With Quote
View Public Profile Visit Kirtan's homepage!
 
Old 10-19-2006, 03:58 AM Re: Doesnt Work in FireFox
seomumbai's Avatar
Skilled Talker

Posts: 98
Trades: 0
I thnk the form tags are necessary to make it work in fire Fox.
seomumbai is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Doesnt Work in FireFox
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16515 seconds with 12 queries