Ember_Celica

Javascript not working properly

Nov 22nd, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.29 KB | None | 0 0
  1. <head>
  2. <title>RenMX Data Center</title>
  3.  
  4. <style>
  5. .suboption {
  6.     display : none;
  7. }
  8. </style>
  9. <script type="text/javascript">
  10. function card_arrSelect(tag){
  11.     var selected = tag.options[tag.selectedIndex].value;
  12.     //alert(selected)
  13.     if (selected == "Type") {
  14.         document.getElementById("Card_Type").style.display = "block";
  15.     }
  16.     if (selected == "Obtained"){
  17.         document.getElementById("Card_Obtained").style.display = "block";
  18.     }
  19.     if (selected == "Cooldown"){
  20.         document.getElementById("Card_Cooldown").style.display = "block";
  21.     }
  22.     if (selected == "Cooldown_Left"){
  23.         document.getElementById("Card_Cooldown_Left").style.display = "block";
  24.     }
  25. }
  26. </script>
  27. </head>
  28. <form id="Data">
  29. <table border=0>
  30. <tr>
  31. <th>Cards</th>
  32. <th>Auctions</th>
  33. <th>Shop</th>
  34. <th>Warehouse</th>
  35. </tr>
  36. <tr>
  37. <td>
  38. <select name="Card_Initial_Filter" onChange="card_arrSelect(this)">
  39. <option value="Type">Card Rarity</option>
  40. <option value="Obtained">Date Obtained</option>
  41. <option value="Cooldown">Cooldown Period</option>
  42. <option value="Cooldown_Left">Cooldown Left</option>
  43. <option value="None" >None</option>
  44. <option value="N/A" selected  disabled>-----</option>
  45. </select>
  46. </td>
  47. <!-- Insert other <select> in more <td> between the <tr> to organize the information horozontially. -->
  48. </tr>
  49. <tr>
  50. <td>
  51. <select name="Card_Type" id="Card_Type" class="suboption" >
  52. <?php
  53. foreach($type as $rarity){
  54.     ?><option value="<?php echo $rarity?>"><?php echo $rarity?></option>
  55.     <?php
  56. }
  57. ?>
  58. <option value="N/A" selected disabled>-----</option>
  59. </select>
  60.  
  61.  
  62. <select name="Card_Obtained" id="Card_Type" class="suboption">
  63. <?php
  64. foreach($obtained as $date){
  65.     ?><option value="<?php echo $date?>"><?php echo $date?></option>
  66.     <?php
  67. }
  68. ?>
  69. <option value="N/A" selected disabled>-----</option>
  70. </select>
  71.  
  72. <select name="Card_Cooldown" id="Card_Type" class="suboption">
  73. <?php
  74. foreach($cooldown as $cd){
  75.     ?><option value="<?php echo $cd?>"><?php echo $cd?></option>
  76.     <?php
  77. }
  78. ?>
  79. <option value="N/A" selected disabled>-----</option>
  80. </select>
  81.  
  82. <select name="Card_Cooldown_Left" id="Card_Type" class="suboption">
  83. <?php
  84. foreach($cooldown_left as $cd_left){
  85.     ?><option value="<?php echo $cd_left?>"><?php echo $cd_left?></option>
  86.     <?php
  87. }
  88. ?>
  89. <option value="N/A" selected disabled>-----</option>
  90. </select>
  91. </td>
  92. </tr>
  93. </table>
Advertisement
Add Comment
Please, Sign In to add comment