Hi,
It would be easier if I could show you this but i'll try my best to explain.
We have designed a form with a basic contact details page. This page has the usual fields, a number of them have immediate validation running against it to check check the content being entered is correct (email and postcode) and to check the field is not null or blank. When the user presses the next button, further validation checks are completed (to get around the fact users could tab over fields and not realise content was required). This works correctly on Firefox, perfect.
Unfortunately I tested it in Safari the other day and noticed that no matter what I typed/selected in the fields with immediate validation the fields would default to blank as soon as the users moved on.
The fields obviously have immediate validation switched on and they have scripts running on the "On Change" event, a sample script is as follows:
if (isBlank(fields.EC_LASTNAME.value)){
controls.TEXT_LASTNAME.show();
controls.LASTNAME.cssClass ="textboxValidate";
}
else {
controls.TEXT_LASTNAME.hide();
controls.LASTNAME.cssClass ="textboxWidth";
}
The isBlank function is:
function isBlank(str) {
return (!str || /^\s*$/.test(str));
}
If I was to remove the immediate validation tick box the problem disappears but of course we no longer get the validation we require.
It seems to be a problem with the on change script vs the immediate validation.
Any thoughts and help would be appreciated.
Safari and field validation...
Moderators: Jon, Steve, Ian, Dave
-
alexmcclune
- Ebase User
- Posts: 95
- Joined: Wed Feb 27, 2013 5:16 pm
-
Jon
- Moderator

- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
I think something is wrong. I tried this with Safari and it works without problem - I tried with Ajax turned on and off. Suggest you click the "Reload page" icon in safari to force a reload of all the Javascript. If that doesn't work, best to export your form and send it to support and we will check whether it works here.
Regards
Jon
Regards
Jon
0 x
Who is online
Users browsing this forum: No registered users and 40 guests