max length on a number field
I have created a adaptive form with both text and number field (zipcode). maxlength works on the text but not on the number field.
When I set maximum characters in the field configuration, I am able to restrict the length on both the fields.
But because I need different character count for different countries on the zipcode, I cannot use the field configuration as it is setting the maximum for all countries.
I am using a rule editor and using the below configuration:
if (this.value == "US") {
document.getElementById("guideContainer-rootPanel-panel_1487583818-guidetextbox_1992592829___widget").type="text";
document.getElementById("guideContainer-rootPanel-panel_1487583818-guidetextbox_1992592829___widget").maxLength=5;
}else if (this.value){
document.getElementById("guideContainer-rootPanel-panel_1487583818-guidetextbox_1992592829___widget").type="text";
document.getElementById("guideContainer-rootPanel-panel_1487583818-guidetextbox_1992592829___widget").maxLength=10;
}
-----------------------
If anybody can help me how to set the maximum length on the number I will really appreciate it.
Thanks,
Neil