Hi,

My site: http://www.orchot-hagilboa.com/index.php?mid=1

My jquery form is working properly in most areas except where i have an online wysiwyg editor.

If you look at the right side of the site, you will see the editor. It creates a textarea form field.

When i send the form, the reply_desc (textarea name) is empty.
I do an alert on that and you can see its empty as well.

The way I grab my textarea is:

var comment = jQuery('textarea[name=reply_desc]'); 
        alert(comment.val());

To take the value i do the following:

if (comment.val()=='') {
                    var error = true;
                    comment.addClass('hightlight');
                    return false;
                } else comment.removeClass('hightlight');

If everything is ok, i sent it to get processed in my php page, but it doesnt even get there because the reply_desc is empty.

Can someone tell me why it is not working with the editor, yet it works fine with a basic <textarea> field???
thanks

Try

var comment = jQuery('textarea[name=reply_desc]').html();
alert(comment.val());

Pretty sure you could go with.
Alert("editor value-->" + comment);

no need for the .val() bit.

HTH

im still getting an empty value.
sending the form (textarea) the regular way works just fine, using $_POST.
I am not sure why its not working with jQuery.
any ideas?

change jQuery('textarea[name=reply_desc]'

to this

jQuery("textarea[name='reply_desc']"

nope. still empty.

Can you post your complete code up?

nope. still empty.

Hi,

before sending your form you need to explicitly set the value of your form field with the rich text editor.

like:

document.forms["formname"].fieldName. value = $(RTObject).value //it depends on what editor you are using.

after that you can submit the form.

HTH

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.