I am using wymeditor in a CMS that is based on jQuery.
This code sets up wymeditor on any textarea with the class "richtextarea"
$('textarea.richtextarea').wymeditor({
updateSelector: "#submitbutton, #submittomail",
updateEvent: "click"
});
In theory, this should cause both the submitbutton and the submittomail button to update wymeditor and submit the form.
However, in this usage, only the first one, submitbutton, does what it should.
The difference is that 'submitbutton' is a "submit" input type, while 'submittoemail' is a "button" input type, with the submission action for the form added via jquery.
$('#submittomail').click(function(){
// other stuff here
$('.admin-form').submit();
});
This seems to cause the form to be submitted before the wymeditor source is updated.
If I change it to a "submit" type , it updates wymeditor as it should, before submitting the form.
But then I have another problem, clicking 'enter' in any field causes the second submit button to be clicked - it should use the current 'submit' button.
This is why I have the other button as a 'button' with the submit added dynamically.
So I either need to force wymeditor to accept the 'button' as an update handler, or add some code before the 'submit()' for the click function, that updates wymeditor then submits the form.
I am open to any change that will make this work the way I need... any ideas?