473,545 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I have javascript code which run successfully on firefox but not on internet Explorer

1 New Member
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3.  
  4. <script type="text/javascript">
  5. var element;
  6. function test(){  
  7.         abc = document.getElementById('promptbox').value;
  8.         document.forms['form0'].elements[element].value = abc; 
  9.         return true;
  10.  
  11. function prompt() {
  12.     el = document.getElementById("prompt");
  13.     el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
  14. }
  15.  
  16.         <!--
  17.         function callPrompt(elementID){
  18.             element = elementID;
  19.             prompt2('btn1p.gif', 'My Prompt','Please enter your information', 'myfunction');
  20.                         prompt();
  21.         }
  22.         //-->
  23.  
  24.         var response = null 
  25.  
  26.             function prompt2(promptpicture, prompttitle, message, sendto) {
  27.                 promptbox = document.createElement('div');
  28.                 promptbox.setAttribute ('id' , 'prompt') 
  29.                     document.getElementsByTagName('body')[0].appendChild(promptbox) 
  30.                     promptbox = eval("document.getElementById('prompt').style") 
  31.                     promptbox.position = 'fixed' 
  32.                     promptbox.top = '150px' 
  33.                     promptbox.left = 0 
  34.                     promptbox.border = 'outset 1 #bbbbbb'  
  35.  
  36.                     document.getElementById('prompt').innerHTML = document.getElementById('prompt').innerHTML + "<table cellspacing='0' cellpadding='5' border='5' width='400px' height='400px' class='promptbox' align='center' bgcolor='#ededed'><tr><td align='center'><table><tr><td><br>" + message + "</td></tr><tr><td align='center'><input type='text' value='' name='promptbox' id='promptbox' onblur='this.focus()' class='promptbox' align='center'></td></tr><tr><td align='right'><br><input type='button' class='prompt' value='OK' onMouseOver='this.style.border=\"1 outset #dddddd\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='prompt();test();'> <input type='button' class='prompt' value='Cancel' onMouseOver='this.style.border=\"1 outset transparent\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(\"\"); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'></td></tr></table></td></tr></table>" 
  37.  
  38.                     document.getElementById("promptbox").focus() 
  39.                 } 
  40.  
  41.         function myfunction(value) { 
  42.  
  43.             if(value.length<=0)
  44.                 return false;
  45.             else
  46.                 document.getElementById('output').innerHTML="<b>"+value+"</b>";
  47.         }
  48. </script>
  49.  
  50. <style type="text/css">
  51. #prompt {
  52.      visibility: hidden;
  53.      position: absolute;
  54.      left: 0px;
  55.      top: 0px;
  56.      width:100%;
  57.      height:100%;
  58.      text-align:center;
  59.      z-index: 100;
  60. }
  61.  
  62. #prompt div {
  63.      width:300px;
  64.      margin: 100px auto;
  65.      background-color: #fff;
  66.      border:1px solid #000;
  67.      padding:15px;
  68.      text-align:center;
  69. }
  70.  
  71. body {
  72.      height:100%;
  73.      margin:0;
  74.      padding:0;
  75. }
  76. </style>
  77.  
  78. </head> 
  79. <body>  
  80. <form name="form0"><br><br><br><br> 
  81. <table align="center" width="500"><tr><td>
  82. Click on a textbox and dialog will appear, The issue is I want each textbox individualized so when the dialog info is entered, its inputted into the correct textbox. I need the dialog to recognize which textbox was clicked thru iteration as there may be hundreds of textboxes.
  83. </td></tr></table>
  84.  
  85. <p align="center">
  86. input1 <input type="text" name="input" id="input1" size ="30" onClick="callPrompt(this.id);"><br><br>
  87. input2 <input type="text" name="input" id="input2" size ="30" onClick="callPrompt(this.id);"><br><br>
  88. input3 <input type="text" name="input" id="input3" size ="30" onClick="callPrompt(this.id);"><br>
  89. And so on.....<br><br></p>
  90.  
  91. <table align="center" width="500"><tr><td align="left">
  92. Example:<br>
  93. I click on textbox "input1".....dialog appears,<br>
  94. I enter "Hello World!".....Then click "Ok",<br>
  95. textbox "input1" is filled in with "Hello World!"<br>
  96. <br>
  97. I click on textbox "input2".....dialog appears,<br>
  98. I enter "Hello World again!".....Then click "Ok",<br>
  99. textbox "input2" is filled in with "Hello World again!"<br>
  100. <br>
  101. I click on textbox "input3".....dialog appears,<br>
  102. I enter "and again Hello World!".....Then click "Ok",<br>
  103. textbox "input3" is filled in with "and again Hello World!"<br>
  104. And so on.....
  105. </td></tr></table> 
  106. </form>
  107.  
  108. </body>
  109. </html>
Sep 23 '08 #1
1 1371
acoder
16,027 Recognized Expert Moderator MVP
What doesn't work? What exactly do you expect it to do and what happens instead?
Sep 23 '08 #2

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

Similar topics

26
4272
by: Patient Guy | last post by:
Has anyone written code that successfully manipulates binary file data using Javascript? It might---and in the case of doing I/O, will---make use of browser- specific functions (ActiveX/COM with Internet Explorer, XPCOM/XPConnect with Mozilla/Firefox). I am writing client-side code that will generate binary data for producing a GIF file...
11
3414
by: minnesotti | last post by:
Hi there, I subscribed to a photographic pictures-hosting website which is heavy on JavaScript. My preferred latest browser Mozilla Firefox does not work with it -- no pictures are displayed and no buttons react to clicking. The website's helpdesk says it should work with Firefox, and could not offer any more advices. The JavaScript Console...
8
1914
by: Matt Kruse | last post by:
http://news.zdnet.com/2100-1009_22-6121608.html Hackers claim zero-day flaw in Firefox 09 / 30 / 06 | By Joris Evers SAN DIEGO--The open-source Firefox Web browser is critically flawed in the way it handles JavaScript, two hackers said Saturday afternoon. An attacker could commandeer a computer running the browser simply by crafting...
3
9830
by: google | last post by:
I am trying to complete a javascript application and am having problems with code similar to that show below. Much testing has shown that Firefox finishes the code shown in around 0.25 secs but Internet Explorer 6 takes a massive 3.5 secs! Internet Explorer 7 gets it down to around 2 seconds - but that's still 8 times slower than Firefox...
16
2305
by: Eric | last post by:
I have a user of a web application written in Java/JSP that is unable to login to the site simply because certain links on the page do not run when they are clicked. Other popups using Javascript on the same page work correctly. It appears to be isolated to 1-2 machines in a particular network. I cannot verify whether these machines have...
12
2565
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more than one line and the text simply overlaps the sub-menus below it. I thought i had got around this by placing empty 'spacers' like so; ...
21
1838
by: TonyV | last post by:
Hi all, I'm trying to use some javascript code in Internet Explorer 6.0 that's being generated by a Perl file. I have a line in my header that looks something like this: <script src="jscode.pl?parm1=foo&parm2=monkey" type="text/javascript" / Just for the sake of simplicity, here's a very simplified version of the Perl code:
26
2244
by: Prisoner at War | last post by:
Hi, All: I have a JavaScript search engine that always causes MSIE 7 to do a top-of-page security "warning" (that top-of-page-bar, and not an "alert" )...but other websites' JavaScripts do not trigger that...what's going on? When I visit other JavaScript sites there's no warning and the scripts work fine, but mine (it's still under...
1
948
by: rameshk_tvm | last post by:
Hi, I have created a web page with javascript, its successfully working in firefox but not in internet explorer version 6 and 7. I am not good in scripting and I have done this page with the help of my friend. I have uploaded the zip file. It contain two directories one is for web page (php_files) other for support file (Support_Files).
0
7502
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...
0
7434
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
7692
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
7946
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...
0
7791
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...
0
6026
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...
1
1921
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
1045
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
744
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.