Forums

date not working with firefox

attucci 13 Feb, 2013
hello,
this morning i had a nice surprise with the date field one a form, nothing changed but the date stopped working when using firefox; with Opera,chrome and IE there is no problem at all, but when using firefox this is what i get




and the code was not modified
<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Data consegna</label>
    <input class="cf_inputbox required validate-date-au" maxlength="150" size="30" title="" id="text_35" name="text_35" type="text" />



did i set something wrong or it's a browser fault?

(i do apologise for my terrible english)
GreyHead 13 Feb, 2013
Hi Attucci,

I'm sorry I don't understand exactly what the problem is? Is one of these messages wrong, or both?

Obviously nothing has changed in ChronoForms unless you have just upgraded.

Please post a link to the form so I can take a quick look.

Bob
attucci 13 Feb, 2013
those 2 error message are what i get when i try to enter a date with firefox, if i enter he date as dd/mm/yyyy the form says to enter it as yyyy/mm/dd and if i do so it tells me to enter it as dd/mm/yyyy and so on


i tried to download an older version of the browser and it works

here is the link to the form
-EDIT-
GreyHead 13 Feb, 2013
Hi attuci,

Ah - that makes sense. We've seen something similar before. I think that FireFox has changed something so MooTools 1.12 no longer reads class names with dashes in them correctly. I suspect that this is something subtle and probably isn't a bug so may not be fixed in this out of date version of MooTools :-(

The validation class you have here is validate-date-au, but FireFox also matches this with validate-date so tries to apply that validation too.

I'm afraid that I don't know of a fix for this; a workaround is to only use 'validate-date'.

Bob

PS I dug around a bit and found that the MooTools uses hasClass() to check the class, which in turn uses 'contains()', which uses indexOf(). Contains is clearly true as 'validate-date-au' contains 'validate-date' so I suspect that this only ever worked because of some other combination of little bugs :-(
attucci 13 Feb, 2013
thank you for your time, i guess that i am lucky that that was just an internal form and i can just tell my coworker to use another browser 🙄

thanks again for your time and sorry for my english
tilallr1 13 Feb, 2013
I am having a similar situation.
http://www.forming.com/index.php/Website-Registration/reg.html

The fields for Organization, Address, and Postal/Zip Code are all working with Alpha-Numeric checks using Internet Explorer and Chrome, but Firefox suddenly stopped working. I believe the issue appeared with Firefox version 18.0.1. It triggers just the Alpha check, which has been causing some issues for people trying to register obviously.

Any idea what we can do to fix it, without shutting it off?
tilallr1 13 Feb, 2013
Well it appears I fixed the problem. As per advice above I researched the problem and discovered that the Mootools library version I have is no longer supported in Firefox 18. I have 1.2 and I believe 1.26 fixes the issues for us legacy users.

But instead of upgrading the Mootools libray, I simply went into the following files:

\www\components\com_chronocontact\libraries\includes\JSvalidation.php
\www\components\com_chronocontact\js\jsvalidation2.js
\www\components\com_chronocontact\js\mooValidation.js

And renamed every instance of:

validate-alphanumber to validate-anum
&
validate-alpha to validate-alp

Done!
GreyHead 13 Feb, 2013
Hi tilallr1,

Excellent, thank you for the update. I was not looking forward to hunting that one down.

Bob
This topic is locked and no more replies can be posted.