Display only select boxes

liunx

Guest
I work in ColdFusion environment. On my form, I have two select boxes. One select box displays names, the other displays addresses.<br />
<br />
I would like to set it up so that if the user clicks on a link on top of the name select box, the user will ONLY be able to select the names. The addresses will still be visible, but display only. <br />
<br />
If the user selects on the addressing link, I want it reversed so the user can only select addresses.<br />
<br />
What I guess I am trying to find out is what is the best way to display a select field, that is display-only.<!--content-->you can say OnClick of select box one, ="document.formName.selectBox2Name.disabled=true"<br />
<br />
just make sure to enable it when you click on it.<!--content--><form><br />
<input type="button" name="doName" value="Name" <br />
onClick="doEnable(this.form.selectName);doDisable(this.form.selectAddress)"><br />
<br />
<input type="button" name="doAddress" value="Address" <br />
onClick="doEnable(this.form.selectAddress);doDisable(this.form.selectName)"><br />
<br />
<select name="selectName"><br />
<option selected value="bill">William</option><br />
<option value="susan">Sue</option><br />
<option value="wendy">Wendy</option><br />
<option value="mike">Michael</option><br />
</select><br />
<br />
<select name="selectAddress" disabled onfocus="this.blur();return false"><br />
<option selected value="NY">New York</option><br />
<option value="LA">Los Angeles</option><br />
<option value="SF">San Francisco</option><br />
</select><br />
<br />
</form><br />
<script language="JavaScript"><br />
function doEnable(obj) {<br />
if (typeof(obj.disabled) != "undefined") <br />
obj.disabled = false // for IE<br />
else<br />
obj.onfocus = null; // for NN<br />
}<br />
<br />
function doDisable(obj) {<br />
if (typeof(obj.disabled) != "undefined") <br />
obj.disabled = true // for IE<br />
else<br />
obj.onfocus = function() { this.blur(); return false };<br />
}<br />
<br />
</script><!--content-->
 
Back
Top