Hi

I found that it doesn't work in IE 9. In Google chrome it works nice.

CommentFileSizeAuthor
#5 clientside_validation_example.zip8.04 KBattiks
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

attiks’s picture

Can you try the demos (http://atix.be/cv6a) and let me know if these work or not?

igorik’s picture

Hi, demo works correctly.

attiks’s picture

@igorik, can you try the demo's on your drupal install as well?

igorik’s picture

I would like to, what I have to do for it?

attiks’s picture

u can use git clone http://git.drupal.org/sandbox/jelles/1193994.git clientside_validation_example or use the zip in attach

igorik’s picture

ok, I have it installed and enabled, but there is no info in the readme, what next, what and where to do.

attiks’s picture

you can find a sample form at /examplesform, i think it's in the navigation menu, but you can access it directly at www.example.be/examplesform

igorik’s picture

Thanks
http://www.somvprahe.sk/examplesform
works nice.
Weird, why then node/add forms in IE9, e.g. http://www.somvprahe.sk/node/add/komunitna-akcia
doesn't work (validate) correctly.

You can try it live if you want, just send me an email on igorik@somvprahe.sk and I will send you login details for testing account.

attiks’s picture

do you get any js errors in ie?

attiks’s picture

Status: Active » Postponed (maintainer needs more info)
igorik’s picture

Title: doesn't work in IE 9 » wysiwyg problem with client side validation

Hi

I have no js errors.

I did some research and I found that this problem is because this module interferre with wysiwyg module.

After submitting some node form with empty required fields, the client validation message is shown, but
wysiwyg js from body textarea is disabled/hidden(all wysiwyg buttons disappear) and the content fo this textarea is shown in html source.

This bug is visible in chrome with wysiwyg prifiles with tinymce, markitup, and ckeditor.
and in IE 9 with markitup, and tinymce.
With combination IE9 + wysiwyg + CKeditor (as wysiwyg profile) client side validation doesn't work at all (this was oriogin of this bug), and after pressing submit, is validation done by php.
Chrome + wysiwyg + ckeditor is using client side validation (but with described bug that all wysiwyg buttons are disappered) if error message is shown(validation didn't pass).

attiks’s picture

Status: Postponed (maintainer needs more info) » Active
attiks’s picture

Assigned: Unassigned » Jelle_S
Jelle_S’s picture

Status: Active » Fixed

The problem was that when a submit button is pressed, wysiwyg editors get detached from their fields, so we had to reattach them if the form had errors. This should solve your problems.

attiks’s picture

Assigned: Jelle_S » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

kingandy’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Closed (fixed) » Active

Still seems to be an issue in the 7.x branch. Can you post the patch that was committed to fix this in 6.x, so that we can port it forward? (Or at least check that the changes are present in our copy...)

attiks’s picture

@kingandy can you provide more information about what modules/editors you're using? Are you using the latest version of this module?

kingandy’s picture

We're using TinyMCE via the WYSYWIG module. We're on Clientside Validation 7.x-1.x-dev, I've just tested it on the latest roll (2011-Oct-15) and it's still occurring.

Actually, on review, this seems to be the reverse of the bug reported in this issue (in #11 - "the client validation message is shown, but
wysiwyg js from body textarea is disabled"). The behaviour that we're experiencing is that text added to a previously-blank rich text area is not detected by the validation script ... basically the content from TinyMCE's virtual text area is not being copied to the actual (hidden) text area before the validation triggers. The rich text editor remains in play, but the validator declares that the required field is empty.

Should I make a separate issue for this or is it related enough to stay here? It does seem to be the same sort of sequencing issue.

attiks’s picture

Assigned: Unassigned » Jelle_S
Status: Active » Needs work
Jelle_S’s picture

Status: Needs work » Fixed

Fixed by making sure our code is executed after the wysiwyg javascript code

kingandy’s picture

Status: Fixed » Needs work

Can you post the patch that implemented the behaviour described in #14 ("we had to reattach [the rich text editors] if the form had errors")? We are genuinely not experiencing this behaviour.

Jelle_S’s picture

Status: Needs work » Fixed

The behaviour that we're experiencing is that text added to a previously-blank rich text area is not detected by the validation script ... basically the content from TinyMCE's virtual text area is not being copied to the actual (hidden) text area before the validation triggers.

Because we now make sure our code is executed after the code of the wysiwyg module the content from TinyMCE's virtual text area is already copied to the actual (hidden) text area before the validation triggers.

We do not have to reattach the rich text editor in 7.x because in wysiwyg.js of wysiwyg-7.x-1.x line 73-80 you will see:

// Detach any editor when the containing form is submitted.
$('#' + params.field).parents('form').submit(function (event) {
  // Do not detach if the event was cancelled.
  if (event.isDefaultPrevented()) {
    return;
  }
  Drupal.wysiwygDetach(context, params[format]);
});

Because Clientside Validation cancels the event if the form is not valid, the wysiwyg editor will not be detached and therefore we won't need to reattach it.

You can test it by downloading the latest dev from git or wait 12 hours until drupal.org updates the dev downloads on the project page

Cheers,
Jelle_S

kingandy’s picture

Installed the latest 7.x-1.x-dev release. Content in rich text editor is now validating correctly, but we are now experiencing the behaviour described in #11 ("the client validation message is shown, but wysiwyg js from body textarea is disabled/hidden(all wysiwyg buttons disappear) and the content for this textarea is shown in html source").

attiks’s picture

Status: Fixed » Needs work
Jelle_S’s picture

Status: Needs work » Fixed

Behavior confirmed and fixed with the same fix used for 6.x.

attiks’s picture

Assigned: Jelle_S » Unassigned
kingandy’s picture

Version: 7.x-1.x-dev » 7.x-1.20

Confirm fixed in 7.x-1.20.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.