This topic is locked

Make an ajax control not editable

10/1/2007 12:19:19 PM
ASPRunnerPro General questions
K
KingDean author

Can't make a field with 5.1 bld 324 hidden.
I have a field that when the user selects the location of the work, it populates with a default worker. I want the user to see this but not be able to change the information.
With ajax edit control i can remove the look of the drop down, but i want it so that the user can't type over or remove the data.
Is there a way to make the field un-clickable?

Sergey Kornilov admin 10/1/2007

Make it readonly in Visual Editor?

K
KingDean author 10/1/2007

Make it readonly in Visual Editor?


If i make it read only there, the field shows up empty on the screen, and no data is ever updated.

J
Jane 10/2/2007

Hi,
you can do it editing BuildEditControl function in the generated include/commonfunctions.asp file.

You should be familiar with JavaScript for that.

Here are some helpful links:

http://www.w3schools.com/htmldom/prop_style_display.asp

http://www.devx.com/tips/Tip/13638
However we don't have a ready to go solution for this.

K
KingDean author 10/2/2007

Hi,

you can do it editing BuildEditControl function in the generated include/commonfunctions.asp file.

You should be familiar with JavaScript for that.

Here are some helpful links:

http://www.w3schools.com/htmldom/prop_style_display.asp

http://www.devx.com/tips/Tip/13638
However we don't have a ready to go solution for this.


THanks for the reply. I am new to web programming, but open for learning. I will check this out and try to implement on your suggestion.
Are there plans for the next release or a sugguestion list yet?

D
dlangham 10/11/2007

You can do this by 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.