Default value readonly

QuestionsDefault value readonly
Leonardo Nencioni asked 10 years ago

Hello,
i call the index.php file passing a variable in url and assign it to a column as default value with $col["editoptions"] = array("defaultValue" => "$pid");
To store this value on new record the cols need editable if possible make it readonly on the add form?

Thank you and good work!

Leonardo

5 Answers
Abu Ghufran answered 10 years ago

Hi,

Pasting from docs:

$col["editoptions"] = array("defaultValue"=>"Test Value","readonly"=>"readonly", "style"=>"border:0");

Abu Ghufran answered 10 years ago

I'll regenerate the case and will update you.

Giovanni Luca Bonelli answered 10 years ago

When I set "readonly" like your example, add routine skip defaultValue. If I delete "readonly", defaultValue is stored correctly but I can change value in the add/edit panel.
Why this??

migul answered 10 years ago

guardar _sesión(id) en un campo por defecto ?????

Abu Ghufran answered 10 years ago

Try following settings, after removing all others.

$col["editrules"]["readonly"] = true;
$col["editoptions"] = array("defaultValue"=>"Test");

Your Answer

20 + 9 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?