473,569 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript & Browser compatiblity?

1 New Member
I'm builiding an online insurance application, where people input thier data, and it gives them rates, then lets them apply. I was wondering if someone could take a look and maybe tell me what the issue is?

Here is the url: http://67.62.217.33/test5

You will need to supply a valid zip, as it does a check for areas the insurance is available. You can use 23834

The issue I'm having is on the the next page there, intro-page2.asp, if you fill in your information or select add a child and then submit that, it takes you to the page with your quotes. No problem there. The problem is that if you use either the back button I have on the page or the browsers in IE, nothing is retained and the dropdowns disappear. But in FF, everything is fine.

Here is the JS I'm using to create the dropdowns:
Expand|Select|Wrap|Line Numbers
  1. function addEvent()
  2. {
  3. var ni = document.getElementById('myDiv');
  4. var numi = document.getElementById('theValue');
  5. //var num = (document.getElementById("theValue").value - 1)+ 2;
  6. var num = (document.getElementById("theValue").value -1)+ 2;
  7. numi.value = num;
  8. var divIdName = "my"+num+"Div";
  9. var newdiv = document.createElement('div');
  10. newdiv.setAttribute("id",divIdName);
  11. newdiv.innerHTML = 
  12. "<tr align=\"right\">"+
  13. "<td width=\"66\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Child&nbsp;&nbsp;&nbsp;</td>"+
  14. "<td width=\"78\">"+
  15. "<select name=\"child"+num+"_gender\" id=\"child"+num+"_gender\">"+
  16. "<option value=\"\" selected>- -<\/option>"+
  17. "<option value=\"Male\">Male<\/option>"+
  18. "<option value=\"Female\">Female<\/option>"+
  19. "<\/select>"+
  20. "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/td>"+
  21. "<td width=\"169\">"+
  22. "<input name=\"child"+num+"_dob_mm\" type=\"text\" id=\"child"+num+"_dob_mm\" style=\"width: 30px;\" />"+
  23. "&nbsp;/ <input name=\"child"+num+"_dob_dd\" type=\"text\" id=\"child"+num+"_dob_dd\" style=\"width: 30px;\" />"+
  24. "&nbsp;/ <input name=\"child"+num+"_dob_yyyy\" type=\"text\" id=\"child"+num+"_dob_yyyy\" style=\"width: 40px;\" />"+
  25. "<\/td>"+
  26. "<td width=\"59\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name=\"child"+num+"_tobacco\" type=\"checkbox\" id=\"child"+num+"_tobacco\" /></td>"+
  27. "<td width=\"74\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name=\"child"+num+"_college\" type=\"checkbox\" id=\"child"+num+"_college\" /></td>"+
  28. "<td width=\"69\" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name=\"child"+num+"_hippa\" type=\"checkbox\" id=\"child"+num+"_hippa\" /></td>"+
  29. "<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:;\" onclick=\"removeEvent(\'"+divIdName+"\')\">Remove<\/a></td>"+
  30. "<\/tr>";
  31. ni.appendChild(newdiv);
  32.  
  33. }
  34.  
  35.  
  36. function removeEvent(divNum)
  37. {
  38. var d = document.getElementById('myDiv');
  39. var olddiv = document.getElementById(divNum);
  40. d.removeChild(olddiv);
  41. }
  42.  
I also included the following snippet of ASP code to the top of my page:
Expand|Select|Wrap|Line Numbers
  1. <% Response.CacheControl = "no-cache" %>
  2. <% Response.AddHeader "Pragma", "no-cache" %>
  3. <% Response.Expires = -1 %>
  4.  
The reason I added this was becasue in IE, when you page back the dropdowns disappear and if you try to re-add them and re-post the page, the values corresponding to the "Add Child" dropdown don't post. However in FF, everything works fine. So that little bit of ASP was the only way I could get the values to refresh & work.

I'm in desperate need of help to figure out the problem here, cause I've tried everything I can think of and I can't get it to work properly in IE.

Thanks in advance.
Oct 3 '06 #1
1 1271
acoder
16,027 Recognized Expert Moderator MVP
Elements added dynamically won't remain once you leave the page, so you need to add them again onload.
May 20 '08 #2

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

Similar topics

14
2803
by: John Bentley | last post by:
Note this is crossposted to comp.lang.javacript and microsoft.public.dotnet.scripting. After some Googling and FAQing my understanding of these terms is, crudely: Javascript (3 different definitions): 1. The scripting language originally developed by Netscape. (I offer a Brief handle: "Original Netscape Script") 2. The current...
14
5437
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net that works well as an html page. It brings up a modal popup window that I have been trying to work out for days now and this was the closest I...
8
2792
by: Nathan Sokalski | last post by:
I add a JavaScript event handler to some of my Webcontrols using the Attributes.Add() method as follows: Dim jscode as String = "return (event.keyCode>=65&&event.keyCode<=90);" TextBox2.Attributes.Add("onKeyPress", jscode) You will notice that jscode contains the JavaScript Logical And operator (&&). However, ASP.NET renders this as...
3
1400
by: Ivan P | last post by:
Hello! I have a index.php that on one click calls via AJAX a file.php. index.php looks like this: <html > <head> <script language="javascript" type="text/javascript" >
11
2767
by: Nathan Sokalski | last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls using the Add method of the Attributes collection. However, if the JavaScript code contains certain characters, such as & or < or several others, it converts them to html, such as &amp; or &lt; which can sometimes cause my scripts not to work. How can I prevent ASP.NET from...
26
1695
by: Laurent Bugnion [MVP] | last post by:
Hi group, In agreement with the head of our R&D department, I published my firm's JavaScript Coding Guidelines. I work for Siemens Building Technologies. We developed these guidelines for a web application project in 2004, based on our C# guidelines. http://www.galasoft-lb.ch/myjavascript/Siemens_SBT_JavaScript_Coding_Guidelines.pdf ...
3
1657
by: DVir | last post by:
I am having problem with IE. This is the code that I am using, and it works good in every browser except in IE. If somebody can help PLEASE: <script language="Javascript" type="text/javascript"> <!-- function showTerms() { var newWin =...
4
1433
by: pmactdot | last post by:
Hi, I'm looking for some assistance on a case study...I have two arrays <head>: one for daily special dish name, second for the daily dish description, then I have two document.write: a daily special dish name <dt>, second to write the daily dish description <dd>. DishName works, just can't figure out the description. The <body> code was...
5
2926
by: Nike1984 | last post by:
I'm fairly new to Javascript and it's more of a guessing game for me... I'm trying to build an app for Google Maps and just had some issues recently. First off I just wanted to say that everything works fine in FF and IE. It's Chrome I'm having issues with. I understand that Chrome is still somewhat in beta stages, so some bugs might occur....
0
7614
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...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8125
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...
1
7676
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...
0
7974
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...
1
5513
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2114
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

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.