[
https://issues.apache.org/jira/browse/OFBIZ-3978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924950#action_12924950
]
Jonatan Soto commented on OFBIZ-3978:
-------------------------------------
Hi Sascha,
This is how I solved the issue, I just added this to the validate method in
profile js. The spans with the error messages are no longer needed. I am
totally agree, generated messages minimizes traffic.
jQuery("#newUserFormStep").validate({
errorPlacement: function(error, element) {
error.appendTo( element.parent("div").find("label") );
},
errorClass: "errorMessage"
});
So to i18n them I just created an external ftl file and put it in the
main-decorator or whatever is desired (even in profile.js, I think it will work
too)
<script>
jQuery.validator.messages.required = '${uiLabelMap.CommonRequired}';
jQuery.validator.messages.email = '${uiLabelMap.CommonRequired}';
jQuery.validator.messages.digits = '${uiLabelMap.CommonRequired}';
</script>
Have in mind that the input element can declare which validation methods are
triggered in the class attribute, but I couldn't make it work for validations
that requires a parameter, like minlength(length). I will investigate further
on this, but I think it can be done if it is defined inside the validate method.
Sorry for don't create a patch, but as I mentioned in the ML I am working in a
step by step wizard for the new customer screen, which is already done. So if
it is ok to you, I can upload a patch including all the changes I've done.
> Ecommerce Migration
> -------------------
>
> Key: OFBIZ-3978
> URL: https://issues.apache.org/jira/browse/OFBIZ-3978
> Project: OFBiz
> Issue Type: Sub-task
> Components: specialpurpose/ecommerce
> Reporter: Ankit Jain
> Assignee: Jacques Le Roux
> Attachments: CheckoutProcess.patch, CheckoutProcess.patch,
> OFBIZ-3978_ecommerceMigration.patch,
> OFBIZ-3978_onePageCheckOutMigration.patch,
> OFBIZ-3978_onePageCheckOutMigration.patch,
> OFBIZ-3978_onePageCheckOutMigration.patch,
> OFBIZ-3978_ProductImageHoverFix.patch, OFBIZ-3978_ProductImageHoverFix.patch,
> popup issue.jpg, smoothness.zip
>
>
> All ecommerce js migration.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.