Forum closed. New forum available at http://community.wymeditor.org/

textarea empty on submit

Support forum for WYMeditor.

textarea empty on submit

Postby coolgeek on Wed Sep 23, 2009 9:07 pm

WYMeditor is the fourth editor I've evaluated in the last few days (after nicedit, fckeditor and tinymce)

I've got it looking just the way I want (eliminated 5 of the toolbar options, hid the classes and containers boxes). And the image and link insert dialogs are just what I want, without all of the extra crap fckeditor and tinymce force on you.

I would be really happy, if only the textarea's post variable was populated upon form submission...

My add forms throw errors on submit, indicating that the field is empty. My edit forms are populated with the expected original value, but after submission result the field remains unchanged.

FF3.0.12, XPSP2
coolgeek
 
Posts: 3
Joined: Wed Sep 23, 2009 8:39 pm

Re: textarea empty on submit

Postby rationbook on Thu Sep 24, 2009 11:25 am

I just spent a couple of hours on pretty much exactly the same problem. Turns out I'd missed the class wymupdate off the forms submit button.
ie. the update button should look something like this...
Code: Select all
<input type="submit" value="Update" name="formupdate" class="wymupdate">
rationbook
 
Posts: 1
Joined: Thu Sep 24, 2009 11:20 am

Re: textarea empty on submit

Postby coolgeek on Thu Sep 24, 2009 3:00 pm

rationbook wrote:I just spent a couple of hours on pretty much exactly the same problem. Turns out I'd missed the class wymupdate off the forms submit button.
ie. the update button should look something like this...
Code: Select all
<input type="submit" value="Update" name="formupdate" class="wymupdate">


rationbook - thanks for the reply

I don't think that that seems to be the problem for me. Here is the relevant HTML

Code: Select all
<textarea style="display: none;" name="ftext" cols="45" rows="10" id="ftext" class="wymeditor">
<input name="submit" value="Create comment" class="wymupdate" type="submit">


(note that the style="display: none;" is generated, rather than in my code)

And here is my jquery function:

Code: Select all
   $(function() {
       $('.wymeditor').wymeditor({
         containersHtml: '',
         classesHtml: '',
         updateSelector: "submit",
         updateEvent: "click",
         toolsItems: [
            {'name': 'Bold', 'title': 'Strong', 'css': 'wym_tools_strong'},
            {'name': 'Italic', 'title': 'Emphasis', 'css': 'wym_tools_emphasis'},
            {'name': 'InsertOrderedList', 'title': 'Ordered_List', 'css': 'wym_tools_ordered_list'},
            {'name': 'InsertUnorderedList', 'title': 'Unordered_List', 'css': 'wym_tools_unordered_list'},
            {'name': 'Undo', 'title': 'Undo', 'css': 'wym_tools_undo'},
            {'name': 'Redo', 'title': 'Redo', 'css': 'wym_tools_redo'},
            {'name': 'CreateLink', 'title': 'Link', 'css': 'wym_tools_link'},
            {'name': 'Unlink', 'title': 'Unlink', 'css': 'wym_tools_unlink'},
            {'name': 'InsertImage', 'title': 'Image', 'css': 'wym_tools_image'},
            {'name': 'InsertTable', 'title': 'Table', 'css': 'wym_tools_table'},
            {'name': 'ToggleHtml', 'title': 'HTML', 'css': 'wym_tools_html'},
            {'name': 'Preview', 'title': 'Preview', 'css': 'wym_tools_preview'}
         ]
      });
   });


Note that I'm not even certain that updateSelector and updateEvent are required, but it doesn't seem to work with or without them

Which brings me to a nagging concern regarding what you have suggested as the problem. Granted, my js skills are not particularly strong, but making behavior dependent on the assignment of a class to an element - to the exclusion of assigning behavior to the element type - seems at best unusual.
coolgeek
 
Posts: 3
Joined: Wed Sep 23, 2009 8:39 pm

Re: textarea empty on submit

Postby rationbook2 on Fri Sep 25, 2009 12:44 am

Same problem, albeit a slight variation....

In your code, where you have

Code: Select all
updateSelector: "submit",

change it to

Code: Select all
updateSelector: ".wymupdate",

or even

Code: Select all
updateSelector: "input",


and you should find it works. The selector you've specified (ie "submit") is an attribute of the input element. The selector, me thinks, should be an element, id or class, not an attirbute. However I'm no js or jq expert either but I'm just happy to get something like this working. There's obviously a lot of effort gone into developing this and I have to say I'm finding this to be an excellent solution, even with it's quirks....but hey, we all have 'em!

What does seem weird is that there's no way of reseeting your password on this forum should you have misplaced it, hence me registering again as rationbook2. :?
rationbook2
 
Posts: 1
Joined: Fri Sep 25, 2009 12:28 am

Re: textarea empty on submit

Postby coolgeek on Fri Sep 25, 2009 3:41 pm

rationbook2 wrote:
Code: Select all
updateSelector: ".wymupdate",

or even

Code: Select all
updateSelector: "input",


and you should find it works. The selector you've specified (ie "submit") is an attribute of the input element. The selector, me thinks, should be an element, id or class, not an attirbute.


rationbook - that does the trick... thanks again!

What is throwing me off is that I haven't come across another plugin editor that requires you to specify the selector and event in order to save the field. (I said in my original post that I wasn't entirely certain that those fields were necessary.) As a design decision, this really puzzles me. As such, I didn't pay too much attention to the possibility that this was the problem.

That said, I changed to

Code: Select all
       $('textarea').wymeditor({

                     . . .

         updateSelector: "input[type='submit']",


so that I don't have to change any of my inputs, and I seem to be running without problem
coolgeek
 
Posts: 3
Joined: Wed Sep 23, 2009 8:39 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests