By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,659 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,659 IT Pros & Developers. It's quick & easy.

insert date into MS access table depending selected dropdown

P: 3
The following is the html page where number of rooms are mention i need to update MS access table depending on the number of rooms selected

hotel.html

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script>
  4. function changeDivDisplay(id)
  5. {
  6.    if(id == "")
  7.      return;
  8.    div1 = document.getElementById("room1");
  9.    div2 = document.getElementById("room2");
  10.    div3 = document.getElementById("room3");
  11.    div4 = document.getElementById("room4");
  12.    div5 = document.getElementById("room5");
  13.  
  14.  
  15.    if(id == "1")
  16.    {
  17.        div1.style.display = "block";
  18.        div2.style.display = "none";
  19.        div3.style.display = "none";
  20.        div4.style.display = "none";
  21.        div5.style.display = "none";
  22.    }
  23.    else if(id == "2")
  24.    {
  25.        div1.style.display = "Block";
  26.        div2.style.display = "block";
  27.        div3.style.display = "none";
  28.     div4.style.display = "none";
  29.        div5.style.display = "none";
  30.  
  31.    }
  32.    else if(id == "3")
  33.    {
  34.        div1.style.display = "block";
  35.        div2.style.display = "block";
  36.        div3.style.display = "block";
  37.     div4.style.display = "none";
  38.        div5.style.display = "none";
  39.  
  40.    }
  41.  else if(id == "4")
  42.    {
  43.        div1.style.display = "block";
  44.        div2.style.display = "block";
  45.        div3.style.display = "block";
  46.     div4.style.display = "block";
  47.        div5.style.display = "none";
  48.  
  49.    }
  50.  else if(id == "5")
  51.    {
  52.        div1.style.display = "block";
  53.        div2.style.display = "block";
  54.        div3.style.display = "block";
  55.     div4.style.display = "block";
  56.        div5.style.display = "block";
  57.  
  58.    }
  59.  
  60. }
  61. </script>
  62.  
  63.  
  64.  
  65. </head>
  66.  
  67. <body>
  68. <form name="myForm" action="hotel_add.asp"  method="post">
  69. <table>
  70. <tr><td><font color="Red">*</font>Number Of Rooms :
  71. <select onchange="changeDivDisplay(this.value)">
  72. <option value="1">1</option>
  73. <option value="2">2</option>
  74. <option value="3">3</option>
  75. <option value="4">4</option>
  76. <option value="5">5</option>
  77.  
  78. </select></td></tr>
  79. <tr id="room1" style="display:block;"><td>Room 1 :&nbsp;&nbsp;&nbsp;&nbsp;</td><td>Rooms Type :<select name="Roomtype1">
  80.   <option>Double</option>
  81.   <option>Twin</option>
  82.   <option>Double plus 1 child</option>
  83.   <option>Twin plus 1 child</option>
  84. <option>Twin for sole use</option>
  85. <option>Single</option>
  86. <option>Triple</option>
  87. <option>Quadruple</option>
  88. </select></td>
  89. <td> Adults :</td><td>
  90. <select name="Adults1">
  91.   <option>1</option>
  92.   <option>2</option>
  93.   <option>3</option>
  94.   <option>4</option>
  95. <option>5</option>
  96. <option>6</option>
  97. <option>7</option>
  98. <option>8</option>
  99. <option>9</option>
  100. <option>10</option>
  101. </select></td>
  102. <td>Children :</td><td>
  103. <select name="Child1">
  104. <option>0</option>
  105.   <option>1</option>
  106.   <option>2</option>
  107.   <option>3</option>
  108.   <option>4</option>
  109. <option>5</option>
  110. <option>6</option>
  111. <option>7</option>
  112. <option>8</option>
  113. <option>9</option>
  114. <option>10</option>
  115. </select></td></tr>
  116.  
  117. <tr id="room2" style="display:none;"><td>Room 2 :&nbsp;&nbsp;&nbsp;&nbsp;</td><td>
  118. Rooms Type :<select name="Roomtype1">
  119.   <option>Double</option>
  120.   <option>Twin</option>
  121.   <option>Double plus 1 child</option>
  122.   <option>Twin plus 1 child</option>
  123. <option>Twin for sole use</option>
  124. <option>Single</option>
  125. <option>Triple</option>
  126. <option>Quadruple</option>
  127. </select></td>
  128. <td> Adults :</td><td>
  129. <select name="Adults1">
  130.   <option>1</option>
  131.   <option>2</option>
  132.   <option>3</option>
  133.   <option>4</option>
  134. <option>5</option>
  135. <option>6</option>
  136. <option>7</option>
  137. <option>8</option>
  138. <option>9</option>
  139. <option>10</option>
  140. </select></td>
  141. <td>Children :</td><td>
  142. <select name="Child1">
  143. <option>0</option>
  144.   <option>1</option>
  145.   <option>2</option>
  146.   <option>3</option>
  147.   <option>4</option>
  148. <option>5</option>
  149. <option>6</option>
  150. <option>7</option>
  151. <option>8</option>
  152. <option>9</option>
  153. <option>10</option>
  154. </select></td></tr>
  155.  
  156. <tr id="room3" style="display:none;"><td>Room 3 :&nbsp;&nbsp;&nbsp;&nbsp;</td><td>
  157. Rooms Type :<select name="Roomtype1">
  158.   <option>Double</option>
  159.   <option>Twin</option>
  160.   <option>Double plus 1 child</option>
  161.   <option>Twin plus 1 child</option>
  162. <option>Twin for sole use</option>
  163. <option>Single</option>
  164. <option>Triple</option>
  165. <option>Quadruple</option>
  166. </select></td>
  167. <td> Adults :</td><td>
  168. <select name="Adults1">
  169.   <option>1</option>
  170.   <option>2</option>
  171.   <option>3</option>
  172.   <option>4</option>
  173. <option>5</option>
  174. <option>6</option>
  175. <option>7</option>
  176. <option>8</option>
  177. <option>9</option>
  178. <option>10</option>
  179. </select></td>
  180. <td>Children :</td><td>
  181. <select name="Child1">
  182. <option>0</option>
  183.   <option>1</option>
  184.   <option>2</option>
  185.   <option>3</option>
  186.   <option>4</option>
  187. <option>5</option>
  188. <option>6</option>
  189. <option>7</option>
  190. <option>8</option>
  191. <option>9</option>
  192. <option>10</option>
  193. </select></td></tr>
  194.  
  195. <tr id="room4" style="display:none;"><td>Room 4 :&nbsp;&nbsp;&nbsp;&nbsp;</td><td>
  196. Rooms Type :<select name="Roomtype1">
  197.   <option>Double</option>
  198.   <option>Twin</option>
  199.   <option>Double plus 1 child</option>
  200.   <option>Twin plus 1 child</option>
  201. <option>Twin for sole use</option>
  202. <option>Single</option>
  203. <option>Triple</option>
  204. <option>Quadruple</option>
  205. </select></td>
  206. <td> Adults :</td><td>
  207. <select name="Adults1">
  208.   <option>1</option>
  209.   <option>2</option>
  210.   <option>3</option>
  211.   <option>4</option>
  212. <option>5</option>
  213. <option>6</option>
  214. <option>7</option>
  215. <option>8</option>
  216. <option>9</option>
  217. <option>10</option>
  218. </select></td>
  219. <td>Children :</td><td>
  220. <select name="Child1">
  221. <option>0</option>
  222.   <option>1</option>
  223.   <option>2</option>
  224.   <option>3</option>
  225.   <option>4</option>
  226. <option>5</option>
  227. <option>6</option>
  228. <option>7</option>
  229. <option>8</option>
  230. <option>9</option>
  231. <option>10</option>
  232. </select></td></tr>
  233.  
  234. <tr id="room5" style="display:none;"><td>Room 5 :&nbsp;&nbsp;&nbsp;&nbsp;</td><td>
  235. Rooms Type :<select name="Roomtype1">
  236.   <option>Double</option>
  237.   <option>Twin</option>
  238.   <option>Double plus 1 child</option>
  239.   <option>Twin plus 1 child</option>
  240. <option>Twin for sole use</option>
  241. <option>Single</option>
  242. <option>Triple</option>
  243. <option>Quadruple</option>
  244. </select></td>
  245. <td> Adults :</td><td>
  246. <select name="Adults1">
  247.   <option>1</option>
  248.   <option>2</option>
  249.   <option>3</option>
  250.   <option>4</option>
  251. <option>5</option>
  252. <option>6</option>
  253. <option>7</option>
  254. <option>8</option>
  255. <option>9</option>
  256. <option>10</option>
  257. </select></td>
  258. <td>Children :</td><td>
  259. <select name="Child1">
  260. <option>0</option>
  261.   <option>1</option>
  262.   <option>2</option>
  263.   <option>3</option>
  264.   <option>4</option>
  265. <option>5</option>
  266. <option>6</option>
  267. <option>7</option>
  268. <option>8</option>
  269. <option>9</option>
  270. <option>10</option>
  271. </select></td></tr>
  272. <tr><td><input type="submit" name="submit" value="Submit" /></td></tr>
  273. </table>
  274. </form>
  275. </body>
  276. </html>
  277.  
Jun 23 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

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