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

How can I submit the content of WYMeditor?

Support forum for WYMeditor.

How can I submit the content of WYMeditor?

Postby sheriff26 on Wed Oct 28, 2009 6:40 pm

Hi all :)
I'm new here an I need some help !

I have this form!
Code: Select all
<form id="message_form">
   <table>
      <tr>
         <td width="40">Catre</td>
         <td><textarea id="to" id="to" name="to" rows="1" style="width: 604px;">{mail_from},</textarea></td>
      </tr>
      <tr>
         <td>Subiect</td>
         <td><input type="text" id="subject" name="subject" style="width: 604px; padding: 3px;" value="{subject}" /></td>
      </tr>
      <tr>
         <td colspan="100%">
            <textarea id="mail_message" name="mail_message" class="wymeditor"><p>{message}</p></textarea>            
         </td>
      </tr>
   </table>
</form>

<button id="send">Send</button>

<script type="text/javascript">
$(document).ready(function() {

          $("#send").click(function() {
      
      alert("Message sent!");

           });
});
</script>



Now ... how the hack can I post the form to /?page=send ??
If it's possible without page refresh.

Thanks
sheriff26
 
Posts: 4
Joined: Wed Oct 28, 2009 6:31 pm

Re: How can I submit the content of WYMeditor?

Postby mr_lundis on Wed Oct 28, 2009 6:45 pm

Hi!
You can use the xhtml instance method to get the content of the editor. See the documentation for more details.

Cheers! ;)
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Re: How can I submit the content of WYMeditor?

Postby sheriff26 on Thu Oct 29, 2009 6:25 pm

I can't figure it out. Could you please show an example ? I'm new to ajax. Thanks.
sheriff26
 
Posts: 4
Joined: Wed Oct 28, 2009 6:31 pm

Re: How can I submit the content of WYMeditor?

Postby mr_lundis on Thu Oct 29, 2009 6:48 pm

This will get the value for the first WYMeditor instance:
Code: Select all
var wym_value = $.wymeditors(0).xhtml();


Cheers! ;)
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Re: How can I submit the content of WYMeditor?

Postby sheriff26 on Sun Nov 01, 2009 8:34 am

Thanks!
sheriff26
 
Posts: 4
Joined: Wed Oct 28, 2009 6:31 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron