- Posts: 154
- Thank you received: 4
address-validation is buggy?
- olivnewton
-
Topic Author
- Offline
Less
More
14 years 7 hours ago #67274
by olivnewton
address-validation is buggy? was created by olivnewton
hello, i just noticed that if someone enters his address-details in login and / or billing / shipping address, if one required field is missing, then the input-field has a red border (styling of class .invalid), which is OK. but after entering some data into that field, and leaving another one empty, the new one gets of course the red border as well, but the old fixed one keeps its red border, even though now valid. i checked with firebug, and found out that the .invalid class does not get removed. is this a bug?
same happens also for the modals in "add new address"
same happens also for the modals in "add new address"
Please Log in or Create an account to join the conversation.
14 years 2 hours ago #67386
by nicolas
Replied by nicolas on topic Re: address-validation is buggy?
It's not a bug. It's just that we don't remove the invalid class.
Please Log in or Create an account to join the conversation.
- olivnewton
-
Topic Author
- Offline
Less
More
- Posts: 154
- Thank you received: 4
14 years 2 hours ago #67390
by olivnewton
Replied by olivnewton on topic Re: address-validation is buggy?
?
excuse if i am not understanding this...
how am i supposed to style back to not-red-border when the field has been corrected?
excuse if i am not understanding this...
how am i supposed to style back to not-red-border when the field has been corrected?
Please Log in or Create an account to join the conversation.
13 years 11 months ago #67681
by nicolas
Replied by nicolas on topic Re: address-validation is buggy?
You need to modify the javascript code in the file media/com_hikashop/js/hikashop.js in order to remove the class from the elements.
Replace the line:
if(!isValid){
by:
if(isValid){
elementToCheck.className.replace( /(?:^|\s)invalid(?!\S)/g , '' );
}
in that file and that should do it once you clear your browser's cache.
Replace the line:
if(!isValid){
by:
if(isValid){
elementToCheck.className.replace( /(?:^|\s)invalid(?!\S)/g , '' );
}
in that file and that should do it once you clear your browser's cache.
The following user(s) said Thank You: olivnewton
Please Log in or Create an account to join the conversation.
- olivnewton
-
Topic Author
- Offline
Less
More
- Posts: 154
- Thank you received: 4
13 years 11 months ago #67701
by olivnewton
Replied by olivnewton on topic Re: address-validation is buggy?
thanks for the tip!
unfortunately your replacement wouldnt work...
this works though:
no offense, but:
you should definitely include this in the next update!
its like buying a BMW, and the low-full-alert appears on the controls-screen.
after refueling, its still red, you call BMW-Service and they tell you how to fix it yourself...
but: great, fast support, as usual!!!
thanks!
unfortunately your replacement wouldnt work...
this works though:
Code:
if(isValid){
elementToCheck.removeClass('invalid');
} else {
no offense, but:
you should definitely include this in the next update!
its like buying a BMW, and the low-full-alert appears on the controls-screen.
after refueling, its still red, you call BMW-Service and they tell you how to fix it yourself...
but: great, fast support, as usual!!!
thanks!
Please Log in or Create an account to join the conversation.
13 years 11 months ago #67737
by nicolas
Replied by nicolas on topic Re: address-validation is buggy?
removeClass won't work without jquery.
Your modification can't be included.
Try like that then :
if(isValid){
elementToCheck.className.replace(new RegExp('(\\s|^)invalid(\\s|$)'),' ').replace(/^\s+|\s+$/g, '');
}
The modification will be included if we can validate it.
Your modification can't be included.
Try like that then :
if(isValid){
elementToCheck.className.replace(new RegExp('(\\s|^)invalid(\\s|$)'),' ').replace(/^\s+|\s+$/g, '');
}
The modification will be included if we can validate it.
Please Log in or Create an account to join the conversation.
- olivnewton
-
Topic Author
- Offline
Less
More
- Posts: 154
- Thank you received: 4
13 years 11 months ago #67744
by olivnewton
Replied by olivnewton on topic Re: address-validation is buggy?
...but it will work with mootools, and mootools is joomla standard enabled
your solution does not work for me:
".invalid" does not get removed!
i keep adding the " else {" otherwise it wouldn work at all, i hope this is correct
your solution does not work for me:
".invalid" does not get removed!
i keep adding the " else {" otherwise it wouldn work at all, i hope this is correct
Please Log in or Create an account to join the conversation.
13 years 11 months ago #67905
by nicolas
Replied by nicolas on topic Re: address-validation is buggy?
We put some other more complex code and properly tested it on our end.
It will be added in next version.
In the mean time you can use your solution.
It will be added in next version.
In the mean time you can use your solution.
Please Log in or Create an account to join the conversation.
- olivnewton
-
Topic Author
- Offline
Less
More
- Posts: 154
- Thank you received: 4
13 years 11 months ago #68044
by olivnewton
Replied by olivnewton on topic Re: address-validation is buggy?
i see. ok.
Please Log in or Create an account to join the conversation.
Time to create page: 0.174 seconds