taoguan / jwysiwyg

Automatically exported from code.google.com/p/jwysiwyg
0 stars 0 forks source link

jwysiwyg doesn't work with jquery validation #83

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install the jquery validation plugin
(http://bassistance.de/jquery-plugins/jquery-plugin-validation/)
2. Make sure you got a textarea with jwysiwyg applied to it
3. Try to fill out the form, and see the difference between normal
textareas and textareas with jwysiwyg applied to them.

Doesn't work as it should. I expect it to validate instantly, but it will
not because the jwysiwyg does something to the textarea which I don't know
what is. Instead, I can only get validation messages when I Submit the form.

I use:
jQuery JavaScript Library v1.3.1
jQuery validation plug-in 1.5.1
WYSIWYG - jQuery plugin 0.5

Original issue reported on code.google.com by marc.f...@gmail.com on 22 Feb 2009 at 5:34

GoogleCodeExporter commented 8 years ago
Of course.....
The jwysiwyg is not the textarea :)
To do a richTE in js people create and iframe in the same position that the 
textarea, and switch it to editmode, 
that allows a user, to interact with the editor. This way when you edit content 
on editor, is not upddated live in 
the textarea, it will be a performance issue... it update, before the form is 
submitted.

Do you understand what I'm saying?

Original comment by jor...@gmail.com on 28 Apr 2009 at 12:28

GoogleCodeExporter commented 8 years ago
Jordic,  while I understand that you cannot fully support validate(),  it seems
wysiwyg() is causing an empty field w/ class="required" to validate and thus 
submit().
Is wysiwyg() changing the class in the dom or putting a value into the textarea 
even
though the user hasn't entered content?  

Original comment by miramard...@gmail.com on 25 Aug 2009 at 4:41

GoogleCodeExporter commented 8 years ago
My guess is when you .hide() the element you removed its required class from 
the dom.

            $(element)
            // .css('display', 'none')
            .hide()
            .before(this.element);

Original comment by miramard...@gmail.com on 25 Aug 2009 at 4:48

GoogleCodeExporter commented 8 years ago

Original comment by akzhan.a...@gmail.com on 27 Jun 2010 at 11:35

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
By default jquery.validate ignores hidden input elements.  When using jwysiwyg 
the underlying textarea element is hidden.

If you pass an empty selector to .validate as the ignore property then the 
textarea will be validated.

e.g.
        $('#theform').validate({
                ignore: ''
            });

Original comment by mangtro...@gmail.com on 31 Jan 2012 at 12:12