I have two webforms on one page but the configuration options I've set do not seem to be being applied.
For the Error message placement I am using a jQuery selector. I have set an exception for my second form 'webform-client-form-569' for error messages to appear above the form. However, with these configuration options error messages for both forms still appear in the jQuery selector div. I would expect with the options I've chosen for the second form's errors to appear above it.
In addition, if I choose the option to only 'validate the forms listed below' and add 'webform-client-form-2' to the list then no validation is applied to the form. A new page is loaded instead. Also if I choose to 'validate all forms except those listed below' and enter 'webform-client-form-569' then this form is still validated on the clientside.
Is anyone able to replicate this problem?
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#4 | clientside_val.jpg | 253.74 KB | Olivaw |
Comments
Comment #1
attiks CreditAttribution: attiks commentedCan u have a look at the source of the page and post Drupal.settings.clientsideValidation?
Do you have a test link so I can see the problem myself, if you don't want to post it, send it using my contact page (http://drupal.org/user/105002/contact)
Comment #2
Olivaw CreditAttribution: Olivaw commentedHi attiks,
There's some other stuff in the Drupal.settings object so I've posted what I think is the clientsideValidation stuff:
"clientsideValidation":{"forms":{"webform-client-form-569":{"errorPlacement":"0","errorJquerySelector":".webform-client-form","customErrorFunction":"","rules":{"submitted[name]":{"required":true,"messages":{"required":"Name field is required.","maxlength":"Name field has a max length of 128 characters."},"maxlength":128},"submitted[email]":{"required":true,"messages":{"required":"Email field is required.","maxlength":"Email field has a max length of 128 characters.","email":"The value in Email is not a valid email address."},"maxlength":128,"email":true},"submitted[message]":{"required":true,"messages":{"required":"Message field is required."}},"files[cv]":{"required":true,"messages":{"required":"CV field is required.","accept":"Only files with a \u003Cem class=\u0022placeholder\u0022\u003Etxt, rtf, html, odf, pdf, doc, docx, ppt, pptx, xls, xlsx, xml, bz2, dmg, gz, jar, rar, sit, tar or zip\u003C\/em\u003E extension are allowed."},"accept":"txt|rtf|html|odf|pdf|doc|docx|ppt|pptx|xls|xlsx|xml|bz2|dmg|gz|jar|rar|sit|tar|zip"}}},"webform-client-form-2":{"errorPlacement":"0","errorJquerySelector":".webform-client-form","customErrorFunction":"","rules":{"submitted[name]":{"required":true,"messages":{"required":"Name field is required.","maxlength":"Name field has a max length of 128 characters."},"maxlength":128},"submitted[company]":{"maxlength":128,"messages":{"maxlength":"Company field has a max length of 128 characters."}},"submitted[email]":{"required":true,"messages":{"required":"Email field is required.","maxlength":"Email field has a max length of 128 characters.","email":"The value in Email is not a valid email address."},"maxlength":128,"email":true}}}},"general":{"errorClass":"error","wrapper":"li","validateTabs":0,"scrollTo":0,"scrollSpeed":1000,"disableHtml5Validation":"0","validateOnBlur":"1","validateOnKeyUp":"0","validateOnSubmit":"1"},"groups":{"webform-client-form-569":[],"webform-client-form-2":[]}},"tableHeaderOffset":"Drupal.toolbar.height"});
I've also emailed you a link to my site.
Thanks for your help.
Comment #3
attiks CreditAttribution: attiks commentedThese settings are both using the same error placement, and the same selector, so that's why the errors show in the same place. Can you post a screenshot of your settings?
Comment #4
Olivaw CreditAttribution: Olivaw commentedI've posted a screenshot of my error placement settings. Under these settings I would expect errors on 'webform-client-form-569' to appear above the form but the errors still appear in the jQuery selector div I've selected.
Comment #5
attiks CreditAttribution: attiks commentedYou're right, it should be. I'll try to have a look later today
Comment #6
attiks CreditAttribution: attiks commentedTry changing all - to _ inside the exception textareas
Comment #7
attiks CreditAttribution: attiks commentedis this working for you?
Comment #8
Jelle_SWe expect Drupal form ID's (the way they come in as parameter in hook_form_alter()) not HTML form id's.
In the latest dev version every - will be replaced with a _
in most cases the html form id will be the same as the drupal form id after this replacement is done.