Guest User

Untitled

a guest
Jul 26th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. IE not executing a form with action a servlet and a complicated input submit
  2. <span style="color:#355D8A;">
  3. <!--SUBMIT-->
  4. <input onMouseOut="this.style.textDecoration='none'; this.style.cursor='auto'" style="background-color:transparent;color:#355D8A;
  5. width:120px; margin-left:0px;" onMouseOver="this.style.textDecoration='underline'; this.style.cursor='pointer'"
  6. type="submit" style="background-color:transparent;" name="cancel1" value="Cancel something"
  7. id="cancel1" /></span >
  8.  
  9. <form action="some_servlet_call" method="post" name="form_name" id="form_id">
  10.  
  11. [...]
  12. <body>
  13. <form action="some_servlet_call" method="post" name="form_name" id="form_id">
  14. <!-- PAGINA -->
  15. <input type="hidden" name="pagina" value="pagina_value" id="pagina" />
  16. [...]
  17. <!--COUNTER-->
  18. <input type="hidden" name="contatore" value="2" id="contatore" />
  19. <!--CODE-->
  20. <input type="hidden" name="code_value1" value="code_value" id="code_value1" />
  21. [...]
  22. <!--CODICE-->
  23. <input type="hidden" name="codice1" id="codice1" value="2" />
  24. [...]
  25. <table width="100%" align="center" >
  26. <tr >
  27. <td>
  28. <!-- SELECT -->
  29. <select id="select1" class="class_example" onChange="myUpdateSelect(1);">
  30. <option id="1option1" selected="selected">Option1</option>
  31. <option id="2option1">Option2</option>
  32. <option id="3option1">Option3</option>
  33. <option id="4option1">Option4</option>
  34. </select>
  35. <!--SELECT ASSOCIATED INPUT-->
  36. <input name="selectHidden1" id="selectHidden1" type="hidden" value="Option1" />
  37. </td>
  38. <td>
  39. <!--EMAIL-->
  40. <input id="email1" class="email_input_class" type="text" name="email1"
  41. onblur="if (this.value == '') {this.value = 'test@mail.com';}" style="width:190px;"
  42. onfocus="if (this.value == 'test@mail.com') {this.value = '';}" value="test@mail.com" />
  43. </td>
  44. [...]
  45. <td>
  46. <span style="color:#355D8A;">
  47. <!--SUBMIT-->
  48. <input onMouseOut="this.style.textDecoration='none'; this.style.cursor='auto'" style="background-color:transparent;color:#355D8A;
  49. width:120px; margin-left:0px;" onMouseOver="this.style.textDecoration='underline'; this.style.cursor='pointer'"
  50. type="submit" style="background-color:transparent;" name="cancel1" value="Cancel something"
  51. id="cancel1" /></span >
  52. </td>
  53. [...]
  54.  
  55. function myUpdateSelect(counter){
  56. var selectId = "select"+counter;
  57. var selectHiddenId = "selectHidden"+counter;
  58. var selectChanged = document.getElementById(selectId);
  59. var selectHiddenChanged = document.getElementById(selectHiddenId);
  60.  
  61. var idOption = selectChanged.options[selectChanged.selectedIndex].id;
  62.  
  63. var selectedOption = document.getElementById(idOption);
  64.  
  65. for(var i=0;i<selectChanged.options.length;i++){
  66. selectChanged.options[i].selected = false;
  67. }
  68. selectedOption.selected = true;
  69.  
  70. selectHiddenChanged.value = selectedOption.value;
  71. }
Add Comment
Please, Sign In to add comment