473,406 Members | 2,707 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,406 software developers and data experts.

Relatively simple javascript question ( I hope ) IE vs. FFox

This comes to be an IE vs. Firefox issue.

What I'm trying to do is 'onchange' of a checkbox have a table display underneath.

Firefox works fine (when you click on the 'Check Here if your Billing Address is different than your Delivery Address." checkbox (following link)

http://www.times-subscription.com/index.php


Problem is, IE doesn't display the table 'onchange'. Instead, once you change the checkbox, you have to click somewhere else on the page in order for the table to display.


The code of the checkbox is here:

<input id="bill_check" type="checkbox" onclick="doIt()" name="bill_checkbox">


The code of the function is here (if its relevant this script is right above the box inside of the body, rather than up in the head):

<script language="JavaScript1.2">
function doIt(){
if(document.getElementById("bill_check").checked)
{
document.getElementById("check").innerHTML="<table ><tr><td class=\"bodytext1\">BILLING FIRST NAME</td><td class=\"padding2\"><input name=\"billing_first_name\" type=\"text\" class=\"formStyle\" size=\"45\"></td></tr><tr><td class=\"bodytext1\">BILLING LAST NAME</td><td class=\"padding2\"><input name=\"billing_last_name\" type=\"text\" class=\"formStyle\" size=\"45\"></td></tr><tr><td class=\"bodytext1\">BILLING ADDRESS 1</td><td class=\"padding2\"><input name=\"bill_address_one\" type=\"text\" class=\"formStyle\" size=\"45\"></td></tr><tr><td class=\"bodytext1\">BILLING ADDRESS 2</td><td class=\"padding2\"><input name=\"bill_address_two\" type=\"text\" class=\"formStyle\" size=\"45\"></td></tr> <tr><tr><td class=\"bodytext1\">BILLING CITY</td><td class=\"padding2\"><input name=\"bill_city1\" type=\"text\" class=\"formStyle\" size=\"45\"></td></tr><tr><td class=\"bodytext1\">BILLING STATE</td><td style=\"padding: 2px; padding-left: 2px;\"><select name=\"bill_state1\"><option value=\"\">--Select One--</option><option value=\"AL\">Alabama</option><option value=\"AK\">Alaska</option><option value=\"AZ\">Arizona</option> <option value=\"AR\">Arkansas</option><option value=\"CA\">California</option><option value=\"CO\">Colorado</option><option value=\"CT\">Connecticut</option><option value=\"DE\">Delaware</option><option value=\"DC\">District of Columbia</option><option value=\"FL\">Florida</option><option value=\"GA\">Georgia</option><option value=\"HI\">Hawaii</option><option value=\"ID\">Idaho</option><option value=\"IL\">Illinois</option> <option value=\"IN\">Indiana</option><option value=\"IA\">Iowa</option><option value=\"KS\">Kansas</option> <option value=\"KY\">Kentucky</option><option value=\"LA\">Louisiana</option><option value=\"ME\">Maine</option><option value=\"MD\">Maryland</option><option value=\"MA\">Massachusetts</option><option value=\"MI\">Michigan</option><option value=\"MN\">Minnesota</option><option value=\"MS\">Mississippi</option><option value=\"MO\">Missouri</option><option value=\"MT\">Montana</option><option value=\"NE\">Nebraska</option> <option value=\"NV\">Nevada</option><option value=\"NH\">New Hampshire</option><option value=\"NJ\">New Jersey</option><option value=\"NM\">New Mexico</option><option value=\"NY\">New York</option><option value=\"NC\">North Carolina</option><option value=\"ND\">North Dakota</option><option value=\"OH\">Ohio</option><option value=\"OK\">Oklahoma</option><option value=\"OR\">Oregon</option> <option value=\"PA\">Pennsylvania</option><option value=\"RI\">Rhode Island</option><option value=\"SC\">South Carolina</option><option value=\"SD\">South Dakota</option><option value=\"TN\">Tennessee</option><option value=\"TX\">Texas</option><option value=\"UT\">Utah</option><option value=\"VT\">Vermont</option><option value=\"VA\">Virginia</option><option value=\"WA\">Washington</option><option value=\"WV\">West Virginia</option><option value=\"WI\">Wisconsin</option><option value=\"WY\">Wyoming</option></select></td></tr><tr><td class=\"bodytext1\">BILLING ZIP</td><td class=\"padding2\"><input name=\"bill_zip1\" type=\"text\" class=\"formStyle\" size=\"45\"></td></tr></table>";
}
else
{
document.getElementById("check").innerHTML="";
}
}
</script>


If anyone has any tips please let me know, much thanks!
Apr 13 '07 #1
2 1284
drhowarddrfine
7,435 Expert 4TB
I'm not a javascript guy but the html/css guy and I'd like to point out a few things.
This is no longer valid:
<script language="JavaScript1.2">
Change it to:
<script type="text/javascript">

Also, you have declared transitional html yet you are using xhtml ending tags. Anything with a /> can cause an element to be closed. Those should all have the slash removed.

There are 133 html errors and two css errors. Most of the html errors are 'alt' errors and javascript related stuff.
Apr 14 '07 #2
hi pal,
your solution is easy

instead of using
onchange="doIt()"
use
onclick="doIt()"

well peace to you
Apr 14 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: deko | last post by:
Is there any way to work around the blank space created by hidden divs? I'm trying to use a relatively postioned divs with show/hide behaviors to annotate an image. The divs show/hide...
6
by: francisco lopez | last post by:
ok , first of all sorry if my english is not so good, I do my best. here is my problem: I don´t know much javascript so I wrote a very simple one to validate a form I have on my webpage. ...
3
by: geotso | last post by:
Hi I use the following script in order to show/hide a section, and at the same time to change a companion .gif with another: function doExpand(paraNum,arrowNum){ if...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
18
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
0
by: Neal | last post by:
Hi All, Help please Cross browser and W3C issues: Having major hassles trying to get my site working and looking decent in FFox (great in IE), MOzzie support said to try the W3C Validator so...
6
by: alex.kemsley | last post by:
Hi guys, I am trying to write a simple script in vain. I need it to first check to see if the cookie exists then if not write one with two variable var ref = document.referrer var page =...
15
by: BT | last post by:
I'm have a problem showing a favicon in ver 1.7.10. It shows up correctly in the address bar, but is missing from the tab. I've tried each of these HTML 'statements' to add the favicon to the page,...
7
by: James Harris | last post by:
My Googling has let me down here - maybe because when it comes to Java I don't really know which type I need! If someone could point me in the right direction I'd appreciate it. My requirement...
10
by: Tom Cole | last post by:
While I've done javascript work for as long as I can remember (since Netscape first released it), I've only ever used it for trivial things, change a color here, validate a text element there, blah...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.