This topic is locked

Read Only Fields

10/13/2012 5:25:40 AM
PHPRunner General questions
T
Tempus_Erus author

Hi,
There is a fair bit in the forum about this topic, but bet option is for 6.1.
I am using 5.3 build 7474. Is there an equivalent work around for:
var ctrl = Runner.getControl(pageid, 'textarea');

ctrl.makeReadonly();

I need a user to be able to read a text area without editing/deleting?
I will be upgrading at some point but time is of the essence on this particular project and its not that easy to merge the projects....
Thanks
A

C
cgphp 10/13/2012

Jquery solution:

$('textarea').attr('readonly','readonly');
T
Tempus_Erus author 10/13/2012



Jquery solution:

$('textarea').attr('readonly','readonly');



Thanks!
I assume on add to the 'java onload' setcion.

C
cgphp 10/13/2012

Yes, add the code to the "Javascript onload" event.

T
Tempus_Erus author 10/13/2012

Brilliant, Thank you once again.

T
Tempus_Erus author 10/14/2012



Brilliant, Thank you once again.


I hav tried snippet of code:
$('textarea').attr('readonly','readonly');
However, this does not work. Is there any more documetayion on this?
Thanks

C
cgphp 10/14/2012
$("value_textarea_" + pageid).attr('readonly','readonly');
T
Tempus_Erus author 10/14/2012


$("value_textarea_" + pageid).attr('readonly','readonly');



no joy with this either <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=68108&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />

C
cgphp 10/14/2012

What is the name of the field? Is it a textarea or a text input?

T
Tempus_Erus author 10/14/2012

the field is called incident_details and is a text area....

C
cgphp 10/14/2012
$('textarea').attr('readonly','readonly');


Are you adding the code to the right event?

T
Tempus_Erus author 10/14/2012


$('textarea').attr('readonly','readonly');


Are you adding the code to the right event?


yes Javscript Onload Event on the Edit page.
The idea will be to restrict the text area to a read only based on a group......
$("value_incidentdetails" + pageid).attr('readonly','readonly');

T
Tempus_Erus author 10/18/2012

Still unable to resolve.
I also have the much documented time picker issue, which in spite of upgrade fails to work.
Long shot, but could these be linked?

C
cgphp 10/18/2012

The following jquery code works fine for me:

$('textarea').attr('readonly','readonly');