Nowadays Opencart use "ajax" to validate forms.
In 2020 exists funcion in controller to validateForm() and avoid send data, but now,
how can I avoid send data to DB if exist error in form?
Thanks
OC version. Just look in the core files for: json['error'] keys ... full of examples in there ...
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I've coded in admin\controller\localisation\language.php in save() function to validate when Save properties for example "enable/disable" language:
.... if (xxxx) then
$json['error'] = "string error"
else
"no error"
But when I set json[error] in php, ajax always store in database, but I need avoid store in database when $json['error'] is set. Now only show "tooltip error message"
How can I do it?
.... if (xxxx) then
$json['error'] = "string error"
else
"no error"
But when I set json[error] in php, ajax always store in database, but I need avoid store in database when $json['error'] is set. Now only show "tooltip error message"
How can I do it?
You could always create a new service request in the Commercial Support section of the forum, or send me a PM directly from the forum, to have this issue solved as a custom job.cahedral wrote: ↑Fri Jun 11, 2021 3:43 amI've coded in admin\controller\localisation\language.php in save() function to validate when Save properties for example "enable/disable" language:
.... if (xxxx) then
$json['error'] = "string error"
else
"no error"
But when I set json[error] in php, ajax always store in database, but I need avoid store in database when $json['error'] is set. Now only show "tooltip error message"
How can I do it?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Now that the issue has been solved with only one word, please add: [SOLVED] at the beginning of the subject line on your first post.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: paulfeakins and 409 guests