This topic is locked

Text area displays as text field in read only mode

8/10/2006 5:42:10 AM
PHPRunner General questions
rjks author

Morning,
I have a text area which I would like to be displayed as read only in the add edit and view pages.
If I set the field to read only, it is displayed as a text field.
How can I set the Display type so that I get a text area with 160 columns and 20 Lines displayed but not editable.
If I do it in the generated code, i.e.

<form action="textarea.htm">

<p>System Information:<br>

<textarea name="SysInfo" cols="160" rows="20" readonly><?php echo ServiceInfo();?></textarea>

</p>

</form>


I will have to edit it after each new geration, I wish to put this in my Template so that when a Text area is defined it can be displayed as a Textarea and not as a text field.
thanks in advance
Robert

rjks author 8/12/2006

Hallo Support,
did you miss this question??
I need to know where I can define the Text Area format in the generated files, can´t semm to find it.
Thanks
Robert

Alexey admin 8/14/2006

Robert,
I'm sorry for the delay with reply.
You can do this modifying generated ..._edit.php file.

Find this snippet there:

if(GetEditFormat("Field")==EDIT_FORMAT_READONLY)

{

...

}


and modify it this way:

if(GetEditFormat("Field")==EDIT_FORMAT_READONLY)

{ ?>

<textarea name="SysInfo" cols="160" rows="20" readonly><?php echo htmlspecialchars($data["Field"]); ?></textarea>

<?php }



where Field is your actual field name.

M
michaelmac 3/9/2009

Hey Support
I have the same issue here with PHPR 5.0 build 766. How do I do the solution offered here now? I have tried to do this now. I have the same thing, I have textarea marked as readonly, and it is only text as readonly and I can not get the textarea to show height and width and say readonly='yes". How do I do this in _edit.php now.
Thanks
Mike