473,385 Members | 1,474 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,385 software developers and data experts.

Problems with IE 6 and Submit/onmouseover.

This works in FireFox but not IE 6. Please advise me with any solutions.

<snippet>

<input type="submit" value="I agree" onMouseOver="hidebox();return false">

</snippet>
Feb 23 '07 #1
6 1710
AricC
1,892 Expert 1GB
This works in FireFox but not IE 6. Please advise me with any solutions.

<snippet>

<input type="submit" value="I agree" onMouseOver="hidebox();return false">

</snippet>
Please show us the full code including the Javascript.

Aric
Feb 23 '07 #2
Expand|Select|Wrap|Line Numbers
  1. var ns4=document.layers
  2. var ie4=document.all
  3. var ns6=document.getElementById&&!document.all
  4.  
  5. //drag drop function for NS 4////
  6. /////////////////////////////////
  7.  
  8. var dragswitch=0
  9. var nsx
  10. var nsy
  11. var nstemp
  12.  
  13. function drag_dropns(name){
  14. if (!ns4)
  15. return
  16. temp=eval(name)
  17. temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
  18. temp.onmousedown=gons
  19. temp.onmousemove=dragns
  20. temp.onmouseup=stopns
  21. }
  22.  
  23. function gons(e){
  24. temp.captureEvents(Event.MOUSEMOVE)
  25. nsx=e.x
  26. nsy=e.y
  27. }
  28. function dragns(e){
  29. if (dragswitch==1){
  30. temp.moveBy(e.x-nsx,e.y-nsy)
  31. return false
  32. }
  33. }
  34.  
  35. function stopns(){
  36. temp.releaseEvents(Event.MOUSEMOVE)
  37. }
  38.  
  39. //drag drop function for ie4+ and NS6////
  40. /////////////////////////////////
  41.  
  42.  
  43. function drag_drop(e){
  44. if (ie4&&dragapproved){
  45. crossobj.style.left=tempx+event.clientX-offsetx
  46. crossobj.style.top=tempy+event.clientY-offsety
  47. return false
  48. }
  49. else if (ns6&&dragapproved){
  50. crossobj.style.left=tempx+e.clientX-offsetx+"px"
  51. crossobj.style.top=tempy+e.clientY-offsety+"px"
  52. return false
  53. }
  54. }
  55.  
  56. function initializedrag(e){
  57. crossobj=ns6? document.getElementById("showimage") : document.all.showimage
  58. var firedobj=ns6? e.target : event.srcElement
  59. var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"? "documentElement" : "body"
  60. while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
  61. firedobj=ns6? firedobj.parentNode : firedobj.parentElement
  62. }
  63.  
  64. if (firedobj.id=="dragbar"){
  65. offsetx=ie4? event.clientX : e.clientX
  66. offsety=ie4? event.clientY : e.clientY
  67.  
  68. tempx=parseInt(crossobj.style.left)
  69. tempy=parseInt(crossobj.style.top)
  70.  
  71. dragapproved=true
  72. document.onmousemove=drag_drop
  73. }
  74. }
  75. document.onmouseup=new Function("dragapproved=false")
  76.  
  77. ////drag drop functions end here//////
  78.  
  79. function hidebox(){
  80. crossobj=ns6? document.getElementById("showimage") : document.all.showimage
  81. if (ie4||ns6)
  82. crossobj.style.visibility="hidden"
  83. else if (ns4)
  84. document.showimage.visibility="hide"
  85. }
  86.  
Expand|Select|Wrap|Line Numbers
  1.  <%if foreignna = "Yes" then%>[HTML]
  2.           </div>
  3.               <div id="showimage" style="position:absolute; width:1500px; left:300px; top:275px; height: 167px;">
  4.  
  5. <table border="0" width="650" bgcolor="#005999" cellspacing="0" cellpadding="2">
  6.   <tr>
  7.     <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"
  8.     height="36px">
  9.       <tr>
  10.         <td id="dragbar" style="cursor:hand; cursor:pointer" width="100%" onMousedown="initializedrag(event)"><ilayer width="100%" onSelectStart="return false"><layer width="100%" onMouseover="dragswitch=1;if (ns4) drag_dropns(showimage)" onMouseout="dragswitch=0"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#FFFFFF"><strong><small>Important Notice to Foreign Nationals</small></strong></font></layer></ilayer></td>
  11.         <!--<td style="cursor:hand"><a href="index.asp" onClick="hidebox();return false"><img src="close.gif" width="19"
  12.         height="14px" border=0></a></td>-->
  13.       </tr>
  14.       <tr>
  15.         <td width="100%" bgcolor="#FFFFFF" style="padding:4px" colspan="4"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#005999">
  16.  
  17.               <div align="left"><font size="3">
  18.                 <!-- PUT YOUR CONTENT BETWEEN HERE -->
  19.                 Technical data authorized for export may not be reexported, transferred or diverted from the country of ultimate end-use or from the authorized foreign end-user or disclosed to a national of another country without the prior written approval of the Office of Defense Trade Controls.
  20. Technical data posted to this website has been authorized for export from the United States to Four Eyes Allied Partners, nationals of Australia, Canada, and the United Kingdom by the Office of Defense Trade Controls, insofar as individual nationality is not diverse from his or her employing agency. <br><br><br>
  21.                  <!--Added a onmouseover as well as onclick event to accommodate two click events-->     
  22.                 <center><input type="submit" value="I agree" onMouseOver="hidebox();return false"></center>
  23.                 <!-- END YOUR CONTENT HERE -->
  24.               </font></div>[/HTML]
  25.                <%else%>
  26.                        <%end if%>    
  27.  
Feb 23 '07 #3
I found a work around. I just inserted the content from one of the DHTML boxes into the other and that eliminated the duplicate "on" events. Also, I inserted some if-then-else code so that only certain users that needed to view the second box content could.
Feb 26 '07 #4
In other words, I just deleted one DHTML box and stuck to one DHTML box and left the Javascript alone. However, I kept the content block from one of the boxes, then copied and pasted it into the single DHTML box between the content block.
Feb 26 '07 #5
AricC
1,892 Expert 1GB
I'm going to move this to the Javascript forum you will most likely get more answers there.
Feb 26 '07 #6
acoder
16,027 Expert Mod 8TB
In the code that you have posted, the div is not closed. That might have been the problem. Also, you are using very old code from the mid-1990s. All modern browsers support document.getElementById.
Feb 27 '07 #7

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

Similar topics

14
by: Chris | last post by:
Heres my problem: <a href="javascript:void(document.buysell.submit())" target="_parent" onMouseOver="MM_swapImage('members','','images/membersf2.gif',1)" onMouseOut="MM_swapImgRestore()"><img...
2
by: Frances Del Rio | last post by:
I have a form in which submit button is an img.. would like to do it w/a rollover, but can't get rollover to work.. can you do rollovers w/img submit buttons? this is code I have: <input...
6
by: nikou_70 | last post by:
I have a page with image, image has some image map, I want to submit form when user mouseover that image map, my code is like this: <img src="Images/floor4.jpg"usemap="#planetmap" id="IMG1">...
3
by: libsfan01 | last post by:
Hi all is it possible to onclick of a button in one form submit that form and also submit another form on the same page, both with the same 'action' location? or is it only possible to send one...
2
by: cbjewelz | last post by:
Hey all. So I'm having problems with cross browser alignments. I'm looking at Safari and Mozilla Firefox. I develop in Safari and so it looks perfect there however in Firefox my vertical...
2
by: funkiejunkie | last post by:
Hello all, I posted a thread a while ago and was told to include the code so here it is. I still dont really get CSS, everything I have done has been blagged because I cant be bothered to read...
34
by: aljamala | last post by:
I keep getting this error for the given code region (it actually highlights the line with the body tag): line 42 column 1 - Warning: <trisn't allowed in <bodyelements </head> <body...
5
by: Rabel | last post by:
I am a flash designer so I dont know a whole lot about the javascript submit buttons (I may not even be describing it right sorry) but here is the code I am using. <IMG name="Checkout"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.