Two questions: Is there a way to force input on the grid edit form to all uppercase?
If I want the default value of a column to be the value of another column in the same table can that be done and how?
If you want to do on client side:
You can set them using editoptions
$col = array();
$col[“title”] = “Name”; // caption of column
$col[“editoptions”] = array(“onkeyup”=>”this.value=this.value.toUpperCase()”);
$cols = $col;
To do this on server side, you can connect on_insert OR on_update event handler and make it strtoupper(). e.g.
$e[“on_insert”] = array(“add_client”, null, true);
$data[“params”][“fullname”] = strtoupper($data[“params”][“fullname”]);
// where fullname is $col[“name”] you want to store in caps.
For 2) Please tell when you need to set default value. Is it on add or edit? if edit, dialog or inline?
Is the field exist in grid from which value need to be read?
Thanks I’ll try that for my all caps issue.
For the second part I would like to have a default edit value. For example: User_Level would be displayed with the current level of Guest, Registered User, or Admin in the original column and then a second column of New_User_Level would be defaulted to whatever the current user level is set to so the admin could leave it as is or better change it.
For #2, Demo here: line 51
It loads value of field ‘name’ in ‘gender’ on form load and inline edit.
How useful was this discussion?
Click on a star to rate it!
Average rating / 5. Vote count:
We are sorry that this post was not useful for you!
Let us improve this post!
Thanks for your feedback!