Readonly in a field don't work Disabled don't work ?

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

Readonly in a field don't work Disabled don't work ?

Post by storm1 »

Hi
I use in a dropdown field

$this->Gespert->ReadOnly=True;

But in edit page i can edit the value and If i put

$this->Gespert->Disabled= True;

the value is erased when this is write in the database

What is wrong?

What can i do?

Thanks


arbei
User
Posts: 9359

Post by arbei »

If you need to control the user from updating a field, you can simply enable the option "Read Only" in [Fields] -> [Edit Page].


storm1
User
Posts: 6

Post by storm1 »

Hi

That is a solution, but I wanted to use that option for using Server Events to control by the user level the possibility of editing or not.

Thank you


mobhar
User
Posts: 11703

Post by mobhar »

  1. Before you disable programmatically that field in the "Page_Render" server event, then you have to get the value of that field, and hold it into a session variable from "Page_Render" server event.

  2. Assign that session variable value back into that field before saving to database by using "Row_Updating" server event. This will avoid the value erased in the database.


storm1
User
Posts: 6

Post by storm1 »

hi

Thanks, is very advanced your comments but i tried to do that.

regards


mobhar
User
Posts: 11703

Post by mobhar »

Sure, just try it by your hand first, and post your code for more discussion.


Post Reply