Non editable field in Add form

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
alescotti73
User
Posts: 57

Non editable field in Add form

Post by alescotti73 »

Hi
I'd like to add in the registration form a disclaimer field, but I need to make it non editable, so the user can read it but not change its content
Is it possible?


kirondedshem
User
Posts: 642

Post by kirondedshem »

you can do one of the following:

1.add it as a custom field and make it readonly.
-right click on the table and click add custom field eg toc
-got to field settings of toc and allow it on add page(it should be by default), set the cotroll you want it to use
-go to field settings->add section->default value and set the default contents that will appear during add eg "the terms and conditions", you can also put a fucntion here.
-to make it readonly, you can either
#put "readonly=true" in custome attribues on filed settings
#OR in add->page->page load, put $this->toc->ReadOnly = TRUE;

  1. You can customise the add template in custom template->add->custom template and draw how you want the controlls on add form to be ordered, here you can add your content anywhere in html. And since you decide how you draw or type the content, you dont have to worry about editting

Webmaster
User
Posts: 9427

Post by Webmaster »

kirondedshem wrote:
in add->page->page load, put $this->toc->ReadOnly = TRUE;

With v2018 you can use Row_Selected server event, see Server Events and Client Scripts in the help file.


alescotti73
User
Posts: 57

Post by alescotti73 »

ok this works

// Page Load event
function Page_Load() {
//echo "Page Load";

$this->fieldName->ReadOnly = TRUE;

}


Post Reply