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
hotel.html
Code:
<html>
<head>
<script>
function changeDivDisplay(id)
{
if(id == "")
return;
div1 = document.getElementById("room1");
div2 = document.getElementById("room2");
div3 = document.getElementById("room3");
div4 = document.getElementById("room4");
div5 = document.getElementById("room5");
if(id == "1")
{
div1.style.display = "block";
div2.style.display = "none";
div3.style.display = "none";
div4.style.display = "none";
div5.style.display = "none";
}
else if(id == "2")
{
div1.style.display = "Block";
div2.style.display = "block";
div3.style.display = "none";
div4.style.display = "none";
div5.style.display = "none";
}
else if(id == "3")
{
div1.style.display = "block";
div2.style.display = "block";
div3.style.display = "block";
div4.style.display = "none";
div5.style.display = "none";
}
else if(id == "4")
{
div1.style.display = "block";
div2.style.display = "block";
div3.style.display = "block";
div4.style.display = "block";
div5.style.display = "none";
}
else if(id == "5")
{
div1.style.display = "block";
div2.style.display = "block";
div3.style.display = "block";
div4.style.display = "block";
div5.style.display = "block";
}
}
</script>
</head>
<body>
<form name="myForm" action="hotel_add.asp" method="post">
<table>
<tr><td><font color="Red">*</font>Number Of Rooms :
<select onchange="changeDivDisplay(this.value)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></td></tr>
<tr id="room1" style="display:block;"><td>Room 1 : </td><td>Rooms Type :<select name="Roomtype1">
<option>Double</option>
<option>Twin</option>
<option>Double plus 1 child</option>
<option>Twin plus 1 child</option>
<option>Twin for sole use</option>
<option>Single</option>
<option>Triple</option>
<option>Quadruple</option>
</select></td>
<td> Adults :</td><td>
<select name="Adults1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select></td>
<td>Children :</td><td>
<select name="Child1">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select></td></tr>
<tr id="room2" style="display:none;"><td>Room 2 : </td><td>
Rooms Type :<select name="Roomtype1">
<option>Double</option>
<option>Twin</option>
<option>Double plus 1 child</option>
<option>Twin plus 1 child</option>
<option>Twin for sole use</option>
<option>Single</option>
<option>Triple</option>
<option>Quadruple</option>
</select></td>
<td> Adults :</td><td>
<select name="Adults1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select></td>
<td>Children :</td><td>
<select name="Child1">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select></td></tr>
<tr id="room3" style="display:none;"><td>Room 3 : </td><td>
Rooms Type :<select name="Roomtype1">
<option>Double</option>
<option>Twin</option>
<option>Double plus 1 child</option>
<option>Twin plus 1 child</option>
<option>Twin for sole use</option>
<option>Single</option>
<option>Triple</option>
<option>Quadruple</option>
</select></td>
<td> Adults :</td><td>
<select name="Adults1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select></td>
<td>Children :</td><td>
<select name="Child1">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select></td></tr>
<tr id="room4" style="display:none;"><td>Room 4 : </td><td>
Rooms Type :<select name="Roomtype1">
<option>Double</option>
<option>Twin</option>
<option>Double plus 1 child</option>
<option>Twin plus 1 child</option>
<option>Twin for sole use</option>
<option>Single</option>
<option>Triple</option>
<option>Quadruple</option>
</select></td>
<td> Adults :</td><td>
<select name="Adults1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select></td>
<td>Children :</td><td>
<select name="Child1">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select></td></tr>
<tr id="room5" style="display:none;"><td>Room 5 : </td><td>
Rooms Type :<select name="Roomtype1">
<option>Double</option>
<option>Twin</option>
<option>Double plus 1 child</option>
<option>Twin plus 1 child</option>
<option>Twin for sole use</option>
<option>Single</option>
<option>Triple</option>
<option>Quadruple</option>
</select></td>
<td> Adults :</td><td>
<select name="Adults1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select></td>
<td>Children :</td><td>
<select name="Child1">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select></td></tr>
<tr><td><input type="submit" name="submit" value="Submit" /></td></tr>
</table>
</form>
</body>
</html>