[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
www.dhtmlgoodies.com • View topic - DHTML Form Validation - onPaste event not Triggered by...
Page 1 of 1

DHTML Form Validation - onPaste event not Triggered by...

PostPosted: Sat Aug 19, 2006 12:57 am
by gecko68

Work around...

PostPosted: Sat Aug 19, 2006 1:47 pm
by gecko68
Here is a work around for the problem with Firefox/Google AutoFill

Prior to submitting (in the onsubmit) I call the following function.
It loops through the form and validates each field one last time.

Please note : In my code, I do not validate hidden, radio , or image types.

function dblcheckFormValidation()
{
var inputFields = document.getElementsByTagName('INPUT');

var inputs = new Array();
for(var no=0;no<inputFields.length;no++){
inputs[inputs.length] = inputFields[no];
}
for(var no=0;no<inputs.length;no++){
if (inputs[no].getAttribute('type') != 'radio' && inputs[no].getAttribute('type') != 'image' && inputs[no].getAttribute('type') != 'hidden') {
validateInput(null,inputs[no])
}
}

}

any updates on the autofill problem yet?

PostPosted: Sat May 24, 2008 4:58 am
by obiwon
This approach to form validation is cool.

I have it in operation on a site.

Folks are really not cool with their autofill not working.

Basically, without an autofill workaround this approach is not going to be production worthy.

I would like to stress that the validation needs to show fields autofilled as validated as soon as the form loads, or within microseconds of page load.

Possible?

setInterval Bandaid approach

PostPosted: Mon May 26, 2008 8:25 am
by obiwon