Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Re: Two Ritch text Editor in one Form Problem

Expand Messages
  • Dav Glass
    Assuming that the id on the form is form1: YAHOO.util.Event.on( form1 , submit , function() { myEditor.saveHTML(); secondEditor.saveHTML(); }); ... -- Dav
    Message 1 of 4 , Jul 24, 2009
    • 0 Attachment
      Assuming that the id on the form is form1:

      YAHOO.util.Event.on('form1', 'submit', function() {
      myEditor.saveHTML();
      secondEditor.saveHTML();
      });


      On Fri, 24 Jul 2009, massoud.kohan wrote:

      > Thanks Dave,
      > Could you tell me how can I add my submit handler ?
      > What would be the codes(example).
      > Thanks,
      > MK
      >
      > --- In ydn-javascript@yahoogroups.com, Dav Glass <davglass@...> wrote:
      > >
      > > handleSubmit does not work for multiple editors in a form..
      > >
      > > You should add your own submit handler and add
      > >
      > > myEditor.saveHTML();
      > > secondEditor.saveHTML();
      > >
      > > That will save both editor's for you..
      > >
      > > Dav
      > >
      > > On Thu, 23 Jul 2009, massoud.kohan wrote:
      > >
      > > > When I have one Rich-text Editor on a HTML Form and submit the form the program works perfect and I can get the Rich text editor data too.
      > > >
      > > > but when I use two Rich-text editor on a Form the progarm submits two times the form data.
      > > > How could I solve that problem?
      > > > If I remove the "handleSubmit: true" for the second Text Editor
      > > > the form does not submit its data.
      > > > Thanks For your help.
      > > > MK
      > > >
      > > >
      > > >
      > > > Here are my short codes.
      > > >
      > > >
      > > > <script language="javascript">
      > > > function upload(){
      > > > parent.startProgress();
      > > > }
      > > > </script>
      > > >
      > > > <form method="post" action="update" enctype="multipart/form-data" onsubmit="upload();">
      > > > <table>
      > > > <tr>
      > > > <td> <div class="yui-skin-sam"> <textarea id="editor" name="editor" rows="20" cols="75"> </textarea></div>
      > > > </td>
      > > > </tr>
      > > > <tr>
      > > > <td class="shadow-l"></td>
      > > > <td> <div class="yui-skin-sam"> <textarea id="descriptive" name="descriptive" rows="20" cols="75"> </textarea></div>
      > > > </td>
      > > > </tr>
      > > > <tr>
      > > > <td> <input type="submit" value="Update Record " id="uploadbutton"></td>
      > > >
      > > >
      > > > </tr>
      > > > </table>
      > > > <script>
      > > >
      > > > (function() {
      > > > var Dom = YAHOO.util.Dom,
      > > > Event = YAHOO.util.Event;
      > > >
      > > > var myConfig = {
      > > > height: '100px',
      > > > width: '550px',
      > > > dompath: true,
      > > > handleSubmit: true,
      > > > focusAtStart: true
      > > > };
      > > > var noSubmit = {
      > > > height: '100px',
      > > > width: '550px',
      > > > dompath: true,
      > > > handleSubmit: true,
      > > > focusAtStart: true
      > > > };
      > > > YAHOO.log('Create the Editor..', 'info', 'example');
      > > > var myEditor = new YAHOO.widget.SimpleEditor('editor', myConfig);
      > > > myEditor._defaultToolbar.buttonType = 'advanced';
      > > > myEditor.render();
      > > > var secondEditor = new YAHOO.widget.SimpleEditor('descriptive',noSubmit);
      > > > secondEditor._defaultToolbar.buttonType = 'advanced';
      > > > secondEditor.render();
      > > >
      > > > })();
      > > > </script>
      > > >
      > >
      > > --
      > > Dav Glass
      > > davglass@...
      > > blog.davglass.com
      > >
      > >
      > > + Windows: n. - The most successful computer virus, ever. +
      > > + A computer without a Microsoft operating system is like a dog
      > > without bricks tied to its head +
      > > + A Microsoft Certified Systems Engineer is to computing what a
      > > McDonalds Certified Food Specialist is to fine cuisine +
      > >
      >
      >

      --
      Dav Glass
      davglass@...
      blog.davglass.com


      + Windows: n. - The most successful computer virus, ever. +
      + A computer without a Microsoft operating system is like a dog
      without bricks tied to its head +
      + A Microsoft Certified Systems Engineer is to computing what a
      McDonalds Certified Food Specialist is to fine cuisine +
    Your message has been successfully submitted and would be delivered to recipients shortly.