Set value of a field in a record in a grid before the edit form is displayed

QuestionsSet value of a field in a record in a grid before the edit form is displayed
Montemaggiore Sebastian asked 8 years ago

Hello Abu. My question is : is possible to set a new value to a field in a record in a grid before the edit form is displayed ?. Of course that field has a value because de grid is link to a table in my database, but the problem is that i don´t want to to show that value because it is encrypted, and i want that the user can give a new value.
Thanks Abu.

1 Answers
Abu Ghufran answered 8 years ago

You can use afterShowForm event of edit form and reset the field value using JS as required.

$opt["edit_options"]["afterShowForm"] = 'function () { … }';

You can inspect the field id.using firebug and use jquery functions to disable / enable desired field.
To know jquery selector:

http://easycaptures.com/fs/uploaded/1017/9892108434.png
http://easycaptures.com/fs/uploaded/1017/9617668813.png

Your Answer

12 + 3 =

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?