Hi,
It's a simple JavaScript task (the code below works, I just tested it):
<html>
<head>
<title>test</title>
<script language = "Javascript">
function checkSelection()
{
//alert(document.job.position.options[document.job.position.selectedIndex].v
alue);
if
(document.job.position.options[document.job.position.selectedIndex].value ==
"other")
{
document.all.othervalue.innerHTML = '<input type="text" name =
"other">'
document.all.otherlabel.innerHTML = '<b>Other:</b>'
}
else
{
document.all.othervalue.innerHTML = ''
document.all.otherlabel.innerHTML = ''
}
}
</script>
</head>
<body>
<form name = "job" action = "##" method = "post">
<table border = "1">
<tr>
<td>
<select name="position" onchange="checkSelection()">
<option value = "Developer">Developer
<option value = "Programmer">Programmer
<option value = "Engineer">Engineer
<option value = "Electrician">Electrician
<option value = "other">Other
</select>
</td>
<td>
<div id = "otherlabel"></div><div id = "other"></div>
</td>
</tr>
<tr>
<td colspan = "2" align = "right">
<input type = "submit" value = "go">
</td>
</tr>
</table>
</form>
</body>
</html>
-----Original Message-----
From: Christopher Olive, CIO [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 06, 2001 7:02 PM
To: CF-Talk
Subject: RE: UI question
you could do a check server side on the action of the form.
<CFIF FORM.myselect EQ "Other" AND NOT Len(FORM.myotherdesc)>
.....whatever error processing you want...
</CFIF>
chris olive, cio
cresco technologies
[EMAIL PROTECTED]
http://www.crescotech.com
-----Original Message-----
From: Jason Lotz [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 06, 2001 2:29 PM
To: CF-Talk
Subject: UI question
I would like some input on how people handle the following situation:
A client wants a form with a "Job Title" select box with 5 options -
Developer
Programmer
Engineer
Electrician
Other
If the user selects "Other" then they have to enter the information in a
text box. Otherwise, the selection in the Select box is sufficient.
Now, my problem isn't programming related. Rather, I am interested in a
good way to handle the user interface for this mess. For example, in VB
it's easy enough to make the text box only appear when "Other" is selected.
However, HTML is not that flexible. It just seems that there might be a
good way to handle this that I'm missing.
Jason
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists