Hi all,
I am new to these forums and decided to join one (this one) after 5 days of researching to try and solve my problem.
I am creating a booking type of calendar. It will be run by an oracle database. From the front end a user will see all the dates that are available (green cells), dates that are pending (orange cells) and dates that are booked (red cells); the user will then click on the dates that are available they want to book, this will turn to yellow, if they change their mind it will turn back to green. This part I am fine with.
The problem I have is with the hidden fields. I would like to change the value of the hidden field from "1, 2" to "1, 2 selected" when the user has clicked on a date. When the page refreshes I would still like the yellow cell to appear and not default back to green. Basically I want to know what dates the user has selected and for the value to go into a database.
I hope I have made sense of what I am trying to do. Any help would be great my code so far is below.
[HTML]<head>
<style type="text/css">
td{width:50px; height:20px; background-color:#009933;}
</style>
<script>
function changeColor(obj TD)
{
if(objTD.clicke d)
{
objTD.style.bac kgroundColor = "009933";
objTD.clicked=f alse;
}
else
{
objTD.style.bac kgroundColor="F FFF00";
objTD.clicked=t rue;
}
}
</script>
</head>
<body>
<form name="check" action="">
<table>
<tr>
<td id="r1w1" onClick="change Color(this)"><i nput type="hidden" id="r1w1b" name="r1w1" value="1,1"></td>
<td id="r1w2" onClick="change Color(this)"><i nput type="hidden" id="r1w2b" name="r1w2" value="1,2"></td>
<td id="r1w3" onClick="change Color(this)"><i nput type="hidden" id="r1w3b" name="r1w3" value="1,3"></td>
<td id="r1w4" onClick="change Color(this)"><i nput type="hidden" id="r1w4b" name="r1w4" value="1,4"></td>
</tr>
</table>
</form>
</body>[/HTML]
I am new to these forums and decided to join one (this one) after 5 days of researching to try and solve my problem.
I am creating a booking type of calendar. It will be run by an oracle database. From the front end a user will see all the dates that are available (green cells), dates that are pending (orange cells) and dates that are booked (red cells); the user will then click on the dates that are available they want to book, this will turn to yellow, if they change their mind it will turn back to green. This part I am fine with.
The problem I have is with the hidden fields. I would like to change the value of the hidden field from "1, 2" to "1, 2 selected" when the user has clicked on a date. When the page refreshes I would still like the yellow cell to appear and not default back to green. Basically I want to know what dates the user has selected and for the value to go into a database.
I hope I have made sense of what I am trying to do. Any help would be great my code so far is below.
[HTML]<head>
<style type="text/css">
td{width:50px; height:20px; background-color:#009933;}
</style>
<script>
function changeColor(obj TD)
{
if(objTD.clicke d)
{
objTD.style.bac kgroundColor = "009933";
objTD.clicked=f alse;
}
else
{
objTD.style.bac kgroundColor="F FFF00";
objTD.clicked=t rue;
}
}
</script>
</head>
<body>
<form name="check" action="">
<table>
<tr>
<td id="r1w1" onClick="change Color(this)"><i nput type="hidden" id="r1w1b" name="r1w1" value="1,1"></td>
<td id="r1w2" onClick="change Color(this)"><i nput type="hidden" id="r1w2b" name="r1w2" value="1,2"></td>
<td id="r1w3" onClick="change Color(this)"><i nput type="hidden" id="r1w3b" name="r1w3" value="1,3"></td>
<td id="r1w4" onClick="change Color(this)"><i nput type="hidden" id="r1w4b" name="r1w4" value="1,4"></td>
</tr>
</table>
</form>
</body>[/HTML]
Comment