This topic is locked

Read only Field

10/10/2008 2:28:08 AM
PHPRunner General questions
S
swanside author

I have a field, this field gets the information put in it from a script, so, I make it read only, on the add page nothing is shown for this field where the script has put the information, but it is shown on the list page.
Is it possible to show the field on the add page, but not be able to click in it to put in values so the script has he full conrol?
Cheers
Paul.

J
Jane 10/10/2008

Hi,
I'm not sure that I understand you correctly. Please re-phrase your question.

If you don't want to change field just set up it as readonly.

S
swanside author 10/10/2008

Hi,

I'm not sure that I understand you correctly. Please re-phrase your question.

If you don't want to change field just set up it as readonly.


OK here goes.
I set up a field called NET as read only.
On the add page I enter a value into the field Amount. The Net is calculated using

<script>

document.forms.editform.value_Amount.onchange=function()

{

document.forms.editform.value_AUDIT_VAT.value=document.forms.editform.value_Amou

nt.value/47*7;

document.forms.editform.value_NET.value=document.forms.editform.value_Amount.val

ue-document.forms.editform.value_AUDIT_VAT.value;

}

</SCRIPT>


It does not show up on the add page if the field is setup as read only, but it will on the list page.
If I set the field on the add page to text field the NET is displayed, but can be edited.
I want the NET to be displayed on the add page using the above script, but not allowing anbody to click in it to change it.
Thanks

Paul.