-----Original Message-----
Currently, I am working on developing a form in
FrontPage. I would like to incorporate a drop-down list
including "Other" as an option, where if "Other" is
selected (or clicked), a text box for fill-in response
will appear.
Is this possible? And, if so, how?
Any help will be greatly appreciated! Thanks!
Here's a sample page that does what you want. Create a new
blank page, switch to code view, delete everything, then
copy and paste from here.
<html>
<head>
<title>Ratings Form</title>
<script>
function ckIfOther(){
if (document.forms[0].ddlRating.selectedIndex ==
document.forms[0].ddlRating.options.length - 1){
if (document.getElementById) {
document.getElementById
("txtOther").style.visibility="visible";
return;
}
if (document.all) {
document.all["txtOther"].style.visibility="visible";
return;
}
if (document.layers) {
document.layers["txtOther"].visibility="show";
}
}else{
if (document.getElementById) {
document.getElementById
("txtOther").style.visibility="hidden";
return;
}
if (document.all) {
document.all["txtOther"].style.visibility="hidden";
return;
}
if (document.layers) {
document.layers["txtOther"].visibility="hide";
}
}
}
</script>
</head>
<body>
<form method="POST">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
<td><select size="1" name="ddlRating"
onchange="ckIfOther();">
<option>Good</option>
<option>Bad</option>
<option>Worse</option>
<option>(other)</option>
</select></td>
<td><input type="text" name="txtOther" size="20"
style="visibility: hidden;"></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="btnSub"></p>
</form>
</body>
</html>
Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------