Closed thelaw29 closed 2 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
You have to use model validation check and raise an error message (read docs) - for example
if ($model->load($post)) {
if (!$model->save()) {
$out = ['output'=>'<your original value>', 'message'=>'Validation error']
} else {
$out = ['output'=>'<your new updated value>', 'message'=>''];
}
}
// $out = Json::encode($out);
Hello,
May I know is there a way to allow the validation in gridview to function as currently it still shows the wrong format of data when updating it. The first pic is to show that it allows the wrong format to be shown but I want to not allow it to be shown when it updates and should revert to its original value. The second picture is the code used for the validation.