hi

thx for the help

i tend not to change the TinyMCE's lib code




i found another work around like this



<t:submit clientId="changeAnotherNameSoThatItIsNotCalledSubmit" value="Upload" />

the actual HTML output will carries the clientId as <input id="" ... />

then the TinyMCE's js is happy now



Davor Hrg wrote:
the attribute is the button actualy because it's probably called "submit"

<t:submit value="Upload"/>




you can try formObj.submit.click();


if(formObj.submit.click) formObj.submit.click();//button click
simulation, onsubmit will be called by browser
else
    if (formObj.onsubmit == null || formObj.onsubmit() != false)
        formObj.submit();//form will be submitted directly so we
tested onsubmit manualy

Davor Hrg

On Fri, Feb 15, 2008 at 9:55 AM, Dapeng <[EMAIL PROTECTED]> wrote:
juz use firebug debugger to stop at the

 formObj.submit()

 i found out that the formObj is indeed the form i need but ...

 it has an attribute submit which equals to a submit button instead of
 submit() method ...



 my codes looks like this

        <t:form>
            <t:textarea value="text.text" style="height:600px"/>

            Upload an image
            <t:upload t:id="file" /> <t:submit value="Upload"/>


 any comment ???





 Davor Hrg wrote:
 > javascript is dynamic so:
 > tinymce.DOM.get(ed.id).form
 > might be something unexpected
 >
 > maybe if you try only this:
 >            formObj = tinymce.DOM.getParent(ed.id, 'form');
 >
 > or use Firefox and Firebug (it is irreplaceable for js development)
 >
 > and add
 > console.log("FORM:" , formObj);
 >
 > after that you can inspect formObj from firebug console
 > and see what is it ...
 >
 >
 > Davor Hrg
 > On Fri, Feb 15, 2008 at 9:31 AM, Dapeng <[EMAIL PROTECTED]> wrote:
 >
 >> so now i am using TinyMCE rich text editor
 >>
 >>  there is a 'SAVE" plugin for TinyMCE
 >>
 >>
 >>
 >>  it is basically calling the form.submit() method from the inclosing
 >>  <form> element
 >>
 >>
 >>  here is the code fragments
 >>
 >>
 >>             formObj = tinymce.DOM.get(ed.id).form ||
 >>  tinymce.DOM.getParent(ed.id, 'form');
 >>
 >>             if (formObj) {
 >>
 >>
 >>                 ed.isNotDirty = true;
 >>
 >>                 if (formObj.onsubmit == null || formObj.onsubmit() != false)
 >>                     formObj.submit();
 >>
 >>
 >>             } else
 >>
 >>
 >>  the codes works perfectly fine with plain HTML
 >>
 >>
 >>  but execute the code with in <t:form> will result in following error
 >>
 >>     formObj.submit is not a function
 >>
 >>  
(function(){tinymce.create('tinymce.plugins.Save',{init:function(ed,url){var
 >>  t=t...
 >>
 >>
 >>
 >>  any suggestion???
 >>
 >>  ---------------------------------------------------------------------
 >>  To unsubscribe, e-mail: [EMAIL PROTECTED]
 >>  For additional commands, e-mail: [EMAIL PROTECTED]
 >>
 >>
 >>
 >
 > ---------------------------------------------------------------------
 > To unsubscribe, e-mail: [EMAIL PROTECTED]
 > For additional commands, e-mail: [EMAIL PROTECTED]
 >
 >


 ---------------------------------------------------------------------
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to