This topic is locked
[SOLVED]

 How to make Text Field Read Only

11/26/2009 6:36:33 AM
ASPRunnerPro General questions
Stu author

I know I can set the field attribute to "ReadOnly" but the text in that field has vbcrlf's in it to make it formatted when viewed as a field.
A ReadOnly field strips them out and the output looks a mess so I can't use it.
The only way I can see is to make the field a Text Field but how can I make sure the user doesn't change the contents. (Its a discussion thread previous replies).
I suppose I could save the contents before an Add and check that when teh user presss save I can make sure the field hasn't changed.
Any suggestions please.
AspRunner 6.0 (6.1 messes up my project!)

J
Jane 11/26/2009

Hi,
you can set up these fields as disabled using custom JavaScript code:

<script>

document.forms.editform.value_FieldName.disabled = true;

</script>



To add JavaScript switch to HTML mode on the Visual Editor tab and add your code at the end of the page.

Stu author 11/30/2009

Thanks so much. Works a treat. Text is slightly dimmed to indicate its not a field that can be edited.
Just for other people's benefit. If the fieldname is "Thread" then the syntax is:-
<script>

document.forms.editform.value_Thread.disabled = true;

</script>
Best Regards for post-Thanksgiving!