Hi Mikejh
You can do this with javascript, but it's harder to control dynamically, and some viewers may have js turned off. If you are populating the form from a database, I assume you will know in advance whether a particular room will be available or not. You may also have other options that change availablility status within the form, and having alerts popup can get ... distracting for the user. (Especially if they have their speaker on high!)
You can also use this far less intrusive method, simply by adding the single word "disabled" to the button in question. If you're pulling from a db, you can actually include that word in the output automatically without having to figure which one needs a separate javascript function.
<html>
<head>
</head>
<body>
<form name="Order" method="post" action="">
<p>Note: Selections not available at this time will be greyed out.</p>
<input name="room" type="radio" value="hotel">Suite
<input name="room" type="radio" value="hotel" disabled>Double
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
Thanks,
Sean
Main Topics
Browse All Topics





by: kanaryPosted on 2003-08-07 at 02:19:54ID: 9098104
hello Mikejh,
Room is Not Available Sorry')" value="radiobutton">
test this code:
<html>
<head>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_popupMsg(msg) {
alert(msg);
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<p>
<input name="room" type="radio" onClick="MM_popupMsg('this
Room1 </p>
<p>
<input name="room" type="radio" onClick="MM_popupMsg('But u can pick this one')" value="radiobutton">
Room2</p>
<p> </p>
<p align="center">
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>