hey all
i need to check to see if my check box is checked, here is my code...
echo "<form id='form1' name='form1' method='post' action='".$href."' onsubmit='return checked_room()'>";
while($row = mysql_fetch_assoc($res))
{
$roomName = $row['RoomName'];
if(!in_array($roomName,$taken_array)){
echo "<div id='RoomBorder'>";
echo "<table width='100%'><tr><th colspan='2'>". $row['RoomName'] ."</th></tr>";
echo "<tr><td colspan='2' align='left'>".$row['RoomDescription']."</td></tr>";
echo "<tr><td><b>Max Guests ".$row['RoomCapacity']."</b></td><td><b>Rates</b></td></tr>";
echo "<tr><td></td><td>".SeasonPrice($roomName)."</td></tr>";
echo "<tr><td>Select desired room:<input type='checkbox' name='SelectRoom[]' value='".$row['RoomName']."'/></td><td align='Left'>";
echo "<input type='submit' name='Next' id='Next' value='Next' /></td></tr>";
echo "</table><br><br>";
echo "</div><br>";
}
}
//<!--End of div RoomBorder-->
echo "</form>";
--------
my validation
---
function checked_room()
{
if(empty($box))
{
echo "You need to check a room inorder to book!";
return false;
}
else
{
return true;
}
}
now for some reason i can't get the javascript to work within the function.
does anyone know what's going on??
shot