Skip to main content

address-validation is buggy?

More
14 years 7 hours ago #67274 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"

Please Log in or Create an account to join the conversation.

More
14 years 2 hours ago #67386 by nicolas
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.

More
14 years 2 hours ago #67390 by olivnewton
?
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.

More
13 years 11 months ago #67681 by nicolas
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.
The following user(s) said Thank You: olivnewton

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #67701 by olivnewton
thanks for the tip!
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.

More
13 years 11 months ago #67737 by nicolas
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.

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #67744 by olivnewton
...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

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #67905 by nicolas
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.

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #68044 by olivnewton
i see. ok.

Please Log in or Create an account to join the conversation.

Time to create page: 0.174 seconds
Powered by Kunena Forum