- Posts: 84
- Thank you received: 0
Validation controls on form
Is it possible to add numeric validation to forms in hikashop. Or is there any other way to add more validation outside of fields? Minimum length, numeric only, valid email or similar ideas? Thanks for any leads!
kind regards,
Luke
Please Log in or Create an account to join the conversation.
The view to be edited will depend on the custom field "table". On which kind of custom fields do you want to do that ?
Please Log in or Create an account to join the conversation.
I would like to try to add some validation for
- valid email adresse
- telephone (numeric only and length validation eg xxxxxxxxxx 10 numbers min and max....
-a customer code (numeric only and length validation eg xxxxxx 6 numbers min and max....
The last two are essentially the same and could be used for validating any numeric value such as code postal or account etc....
Of course I have already accomplished the max values through default options
Thanks for any more advice!
Luke
Please Log in or Create an account to join the conversation.
Are you talking about a different place ?
Please Log in or Create an account to join the conversation.
I am referring to fields I have added into my adresse table, since no registration is required.
kindly,
Luke
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
How could modify the validation of username on the registration form ?
thanks
Please Log in or Create an account to join the conversation.
Theere is no system to add checks to the username field. It would require custom javascript code to be added to the file "registration" of the view "user" via the menu Display>Views.
On a side note, it is now possible to add validation controls on the custom fields of the address/user forms with the "regex check" field of the custom fields.
Please Log in or Create an account to join the conversation.
Not where I have to put.
Thanks Nicolas
Please Log in or Create an account to join the conversation.
This attribute is not supported for all the browsers:
www.w3schools.com/tags/att_input_pattern.asp
So make sure that your browser supports it.
Also, the "registration" file is only used when the "use bootstrap design" setting is turned off. If it's on, it's the file registration_bootstrap that you want to edit to add that attribute.
Please Log in or Create an account to join the conversation.
Different tests performed it with the pattern attribute.
But me the following questions arise :
1. Indeed in some browsers do not work in any case.
2. Even in the test so I've done by adding a field called country code , works for example in chrome and change the pattern assigned username does not. I do not understand why.
Best regards and thanks for your patience .
Please Log in or Create an account to join the conversation.
You're missing a double quote for the pattern attribute value of the username field:
take.ms/JYqBK
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
how do I do to:
force data save this form in capital letters ?.
I mean the registration form
Thank you.
Please Log in or Create an account to join the conversation.
You can try to use such regex check:
Please Log in or Create an account to join the conversation.
No where to place : strtoupper , if that is the correct method .
A cordial greeting,
David
Please Log in or Create an account to join the conversation.
Then it's not a validation you want but an action.
In that case, I would recommend to try with mass actions like this :
take.ms/18rGX
You can configure them via the menu System>Mass actions.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I tried to apply the solution you've given me .
But I do not get it to work .
Greetings,
David
Please Log in or Create an account to join the conversation.
I just tried on my local and the address is correctly edited via the mass action with the same setup than you.
Just to be sure, the used trigger is "after an address is created" right ? If not, so that's the issue.
Please Log in or Create an account to join the conversation.