Implemented also for edit form

The logic of the javascript module has to consider also the situation
in which the dataset is being edited