Javascript Function Not Working In IE

  • Pope Pius X2
  • Born
  • Born
  • Pope Pius X2
  • Posts: 1

Post 3+ Months Ago

I have a Javascript function to display a different <form> each time a drop down box is clicked. All forms are set to display: none but when one of the options in the drop down box is clicked, one appears. If another is clicked, the current one appearing disappears and the new one appears. It works fine in Firefox but not in Internet Explorer 6 or 7 and I don't know why. My code is as follows:

Code: [ Select ]
 
function showm(ob,ob2,ob3) {
   
    document.getElementById(ob).style.display = 'block'
    document.getElementById(ob2).style.display = 'none'
    document.getElementById(ob3).style.display = 'none'
}
 
  1.  
  2. function showm(ob,ob2,ob3) {
  3.    
  4.     document.getElementById(ob).style.display = 'block'
  5.     document.getElementById(ob2).style.display = 'none'
  6.     document.getElementById(ob3).style.display = 'none'
  7. }
  8.  

HTML Code: [ Select ]
 
<form id="form1" name="form1" method="post" action="">
  <select name="changer" id="changer">
    <option value="" selected="selected">Please select your delivery area</option>
    <option value="SWD S09 UK" onclick="showm('swd_s09_uk','swd_s09_eu','swd_s09_rw')">United Kingdom</option>
    <option value="SWD S09 EU" onclick="showm('swd_s09_eu','swd_s09_uk','swd_s09_rw')">Europe</option>
    <option value="SWD S09 RW" onclick="showm('swd_s09_rw','swd_s09_uk','swd_s09_eu')">Rest of World</option>
  </select>
</form>
 
 
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="swd_s09_uk" style="display:none;">
Paypal button
</form>
 
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="swd_s09_eu" style="display:none;">
Paypal button
</form>
 
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="swd_s09_rw" style="display:none;">
Paypal button
</form>
 
  1.  
  2. <form id="form1" name="form1" method="post" action="">
  3.   <select name="changer" id="changer">
  4.     <option value="" selected="selected">Please select your delivery area</option>
  5.     <option value="SWD S09 UK" onclick="showm('swd_s09_uk','swd_s09_eu','swd_s09_rw')">United Kingdom</option>
  6.     <option value="SWD S09 EU" onclick="showm('swd_s09_eu','swd_s09_uk','swd_s09_rw')">Europe</option>
  7.     <option value="SWD S09 RW" onclick="showm('swd_s09_rw','swd_s09_uk','swd_s09_eu')">Rest of World</option>
  8.   </select>
  9. </form>
  10.  
  11.  
  12. <form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="swd_s09_uk" style="display:none;">
  13. Paypal button
  14. </form>
  15.  
  16. <form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="swd_s09_eu" style="display:none;">
  17. Paypal button
  18. </form>
  19.  
  20. <form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="swd_s09_rw" style="display:none;">
  21. Paypal button
  22. </form>
  23.  
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 156 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.