This topic is locked

How to make a dropdown box look like a disabled text box

11/9/2007 5:57:41 AM
ASPRunnerPro Tips and tricks
D
dlangham author

You can do this by changing your dropdown box to Ajax type and then switching to HTML mode of the Add and/or Edit page.

Then find </body> tag in the end of the page code and insert this snippet just before it:

<script>

document.getElementById("display_value_Field1").disabled=true;

document.getElementById("display_value_Field2").disabled=true;

</script>


Where Field1, Field2 in BOLD are your actual dependent field names.
document.getElementById("displayvalueField1").disabled=true;

document.getElementById("displayvalueField2").disabled=true;
This will then give you what looks like a disabled text box, but will still get populated from the original drop down.

A
ABC 2/14/2008

Do you happen to know how to then format the size of the resulting "textbox"?
Thanks

Sunrise 12/29/2008

On 5.1 this one worked <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=36326&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
[codebox]<script>

document.getElementById("display_value_Field1").size=30;

document.getElementById("display_value_Field1").disabled=true;

document.getElementById("display_value_Field2").size=30;

document.getElementById("display_value_Field2").disabled=true;

</script>[/codebox]