[jQuery] Re: Validate() and TinyMCE problem

2007-06-27 Thread Diego A.

Ideally...
OR, the FCK plugin could integrate itself to the others the same way I
integrate it with the Form plugin. But since we're talking about mix-
matching plugins, this would require some feedback from the plugins'
authors...

eg.:
// find existing method to override
if($.fn.ajaxSubmit){

 // archive the method
 $.fn.ajaxSubmit_ = $.fn.ajaxSubmit;

 // override the method
 $.fn.ajaxSubmit = function(){

  // do this plugin's stuff
  $.FCK(1); // update html

  // call original method
  $.fn.ajaxSubmit_.apply(this, arguments);

  // don't break the chain...
  return $(this);

 };

};


On Jun 26, 7:23 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Diego A. wrote:
  Sorry about the delay...
  I took long to reply because I've been away on holiday.

  Here's a little something I've put together:
 http://www.fyneworks.com/jquery/FCKEditor/

  Let me know what you think!

 Looks good. It wouldn't hurt to provide explicit methods for init and
 update.

 For integration with validation the validation plugin could check for
 $.FCK and call it to update before validating a form, right?

 --
 Jörn Zaefferer

 http://bassistance.de



[jQuery] Re: Validate() and TinyMCE problem

2007-06-27 Thread Diego A.

I've started a new thread here:
http://groups.google.com/group/jquery-en/browse_frm/thread/f649148d8ff5511a
...so more people can check it out and tell us what they think.

On Jun 27, 6:15 pm, Diego A. [EMAIL PROTECTED] wrote:
 Ideally...
 OR, the FCK plugin could integrate itself to the others the same way I
 integrate it with the Form plugin. But since we're talking about mix-
 matching plugins, this would require some feedback from the plugins'
 authors...

 eg.:
 // find existing method to override
 if($.fn.ajaxSubmit){

  // archive the method
  $.fn.ajaxSubmit_ = $.fn.ajaxSubmit;

  // override the method
  $.fn.ajaxSubmit = function(){

   // do this plugin's stuff
   $.FCK(1); // update html

   // call original method
   $.fn.ajaxSubmit_.apply(this, arguments);

   // don't break the chain...
   return $(this);

  };

 };

 On Jun 26, 7:23 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote:

  Diego A. wrote:
   Sorry about the delay...
   I took long to reply because I've been away on holiday.

   Here's a little something I've put together:
  http://www.fyneworks.com/jquery/FCKEditor/

   Let me know what you think!

  Looks good. It wouldn't hurt to provide explicit methods for init and
  update.

  For integration with validation the validation plugin could check for
  $.FCK and call it to update before validating a form, right?

  --
  Jörn Zaefferer

 http://bassistance.de



[jQuery] Re: Validate() and TinyMCE problem

2007-06-26 Thread Diego A.

Sorry about the delay...
I took long to reply because I've been away on holiday.

Here's a little something I've put together:
http://www.fyneworks.com/jquery/FCKEditor/

Let me know what you think!

On Jun 12, 8:28 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Diego A. wrote:
  Keep in mind I don't using TinyMCE, I use FCKEditor, but the principle
  should be the same...

  Basically, I write a small plugin that is responsible for
  1. Creating an instance of the editor
  2. Retrieving the HTML content from the editor and 'preparing' it for
  form submission

  For example...
  $.FCK.Start(); // creates the editors
  $.FCK.Update(); // updates the editors

  At the moment, all my form submissions go through one function that
  will always call the $.FCK.Update() method, but this could be
  integrated with other plugins - in their configuration
  For example...
  if (options.FCKEditor) $.FCK.Update();

  My implementation is very specific to my needs, but I can send you the
  code and help you work on a more generic solution if you like.

 That would indeed be interesting!

 --
 Jörn Zaefferer

 http://bassistance.de



[jQuery] Re: Validate() and TinyMCE problem

2007-06-26 Thread Jörn Zaefferer


Diego A. wrote:

Sorry about the delay...
I took long to reply because I've been away on holiday.

Here's a little something I've put together:
http://www.fyneworks.com/jquery/FCKEditor/

Let me know what you think!
  
Looks good. It wouldn't hurt to provide explicit methods for init and 
update.


For integration with validation the validation plugin could check for 
$.FCK and call it to update before validating a form, right?


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Validate() and TinyMCE problem

2007-06-12 Thread Jörn Zaefferer


Diego A. wrote:

Keep in mind I don't using TinyMCE, I use FCKEditor, but the principle
should be the same...

Basically, I write a small plugin that is responsible for
1. Creating an instance of the editor
2. Retrieving the HTML content from the editor and 'preparing' it for
form submission

For example...
$.FCK.Start(); // creates the editors
$.FCK.Update(); // updates the editors

At the moment, all my form submissions go through one function that
will always call the $.FCK.Update() method, but this could be
integrated with other plugins - in their configuration
For example...
if (options.FCKEditor) $.FCK.Update();

My implementation is very specific to my needs, but I can send you the
code and help you work on a more generic solution if you like.
  

That would indeed be interesting!

--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Validate() and TinyMCE problem

2007-06-11 Thread Diego A.

Keep in mind I don't using TinyMCE, I use FCKEditor, but the principle
should be the same...

Basically, I write a small plugin that is responsible for
1. Creating an instance of the editor
2. Retrieving the HTML content from the editor and 'preparing' it for
form submission

For example...
$.FCK.Start(); // creates the editors
$.FCK.Update(); // updates the editors

At the moment, all my form submissions go through one function that
will always call the $.FCK.Update() method, but this could be
integrated with other plugins - in their configuration
For example...
if (options.FCKEditor) $.FCK.Update();

My implementation is very specific to my needs, but I can send you the
code and help you work on a more generic solution if you like.

Just let me know...
On Jun 7, 1:36 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Diego A. wrote:
  I don't use TinyMCE but I have a similar problem with FCKEditor and
  Codepress (both JS based rich-text editors).

  Usually, these RT editors update the contents of the field/textarea
  element just before the form is submitted, which probably happens
  after your validation.

  I work around it by manually updating the value of the field/textarea
  before I call the validation/submit the form.

 Could you describe in more detail how you do that? As this issue is
 quite likely to occur for others, I'd like to write examples showing how
 to integrate validation with those editors.

 --
 Jörn Zaefferer

 http://bassistance.de



[jQuery] Re: Validate() and TinyMCE problem

2007-06-07 Thread Jörn Zaefferer


 Has anyone found a way around this? Do I have to validate() the 
TinyMCE input iframe(?) rather than the text box?


Could you post an example page?

--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Validate() and TinyMCE problem

2007-06-07 Thread Diego A.

I don't use TinyMCE but I have a similar problem with FCKEditor and
Codepress (both JS based rich-text editors).

Usually, these RT editors update the contents of the field/textarea
element just before the form is submitted, which probably happens
after your validation.

I work around it by manually updating the value of the field/textarea
before I call the validation/submit the form.

Hope that helps.

On Jun 7, 9:59 am, Luc Pestille [EMAIL PROTECTED] wrote:
 Hi all,
 I have a problem when using a TinyMCE replaced textarea as a field that
 needs validating - validate() requires me to press submit twice before
 the field is recognised as filled - I presume because the actual
 underlying textarea is empty until TinyMCE copies content back into it
 on submit.

 Has anyone found a way around this? Do I have to validate() the TinyMCE
 input iframe(?) rather than the text box?

 Thanks,
 Luc Pestille
 Web Designer

 in2, Thames House, Mere Park, Dedmere Road, Marlow, Bucks, SL7 1PB
 tel: +44 (1628) 899700  |  fax: +44 (1628) 899701  |  email: [EMAIL 
 PROTECTED]  |  web:www.in2.co.uk
 This message (and any associated files) is intended only for the use of 
 jquery-en@googlegroups.com and may contain information that is confidential, 
 subject to copyright or constitutes a trade secret. If you are not 
 jquery-en@googlegroups.com you are hereby notified that any dissemination, 
 copying or distribution of this message, or files associated with this 
 message, is strictly prohibited. If you have received this message in error, 
 please notify us immediately by replying to the message and deleting it from 
 your computer. Messages sent to and from us may be monitored. Any views or 
 opinions presented are solely those of the author jquery-en@googlegroups.com 
 and do not necessarily represent those of the company.

  in2logo_long.gif
 13KViewDownload



[jQuery] Re: Validate() and TinyMCE problem

2007-06-07 Thread Jörn Zaefferer


Diego A. wrote:

I don't use TinyMCE but I have a similar problem with FCKEditor and
Codepress (both JS based rich-text editors).

Usually, these RT editors update the contents of the field/textarea
element just before the form is submitted, which probably happens
after your validation.

I work around it by manually updating the value of the field/textarea
before I call the validation/submit the form.
  
Could you describe in more detail how you do that? As this issue is 
quite likely to occur for others, I'd like to write examples showing how 
to integrate validation with those editors.


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Validate() and TinyMCE problem

2007-06-07 Thread bbuchs

In simple terms, you need to move the content from the TinyMCE
control to the textarea for validation.

$('button.save').click(function(){
if (tinyMCE) tinyMCE.triggerSave();
});

http://wiki.moxiecode.com/index.php/TinyMCE:Functions#tinyMCE.triggerSave




On Jun 7, 7:36 am, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Diego A. wrote:
  I don't use TinyMCE but I have a similar problem with FCKEditor and
  Codepress (both JS based rich-text editors).

  Usually, these RT editors update the contents of the field/textarea
  element just before the form is submitted, which probably happens
  after your validation.

  I work around it by manually updating the value of the field/textarea
  before I call the validation/submit the form.

 Could you describe in more detail how you do that? As this issue is
 quite likely to occur for others, I'd like to write examples showing how
 to integrate validation with those editors.

 --
 Jörn Zaefferer

 http://bassistance.de



[jQuery] Re: Validate() and TinyMCE problem

2007-06-07 Thread Luc Pestille

That was exactly what I was looking for, thanks Buchs. In my case it was the 
below, just before I call validate();

$('#admin-jobs .submit').click(function(){
if (tinyMCE){ tinyMCE.triggerSave(); }
});

I don't know if this could be integrated in to validate() itself, so that other 
people don't have to come asking/searching for the answer?


Luc Pestille
Web Designer 


-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of bbuchs
Sent: 07 June 2007 14:00
To: jQuery (English)
Subject: [jQuery] Re: Validate() and TinyMCE problem


In simple terms, you need to move the content from the TinyMCE control to the 
textarea for validation.

$('button.save').click(function(){
if (tinyMCE) tinyMCE.triggerSave();
});

http://wiki.moxiecode.com/index.php/TinyMCE:Functions#tinyMCE.triggerSave




On Jun 7, 7:36 am, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Diego A. wrote:
  I don't use TinyMCE but I have a similar problem with FCKEditor and 
  Codepress (both JS based rich-text editors).

  Usually, these RT editors update the contents of the field/textarea 
  element just before the form is submitted, which probably happens 
  after your validation.

  I work around it by manually updating the value of the 
  field/textarea before I call the validation/submit the form.

 Could you describe in more detail how you do that? As this issue is 
 quite likely to occur for others, I'd like to write examples showing 
 how to integrate validation with those editors.

 --
 Jörn Zaefferer

 http://bassistance.de 

 


in2, Thames House, Mere Park, Dedmere Road, Marlow, Bucks, SL7 1PB
tel: +44 (1628) 899700  |  fax: +44 (1628) 899701  |  email: [EMAIL PROTECTED]  
|  web: www.in2.co.uk
This message (and any associated files) is intended only for the use of 
jquery-en@googlegroups.com and may contain information that is confidential, 
subject to copyright or constitutes a trade secret. If you are not 
jquery-en@googlegroups.com you are hereby notified that any dissemination, 
copying or distribution of this message, or files associated with this message, 
is strictly prohibited. If you have received this message in error, please 
notify us immediately by replying to the message and deleting it from your 
computer. Messages sent to and from us may be monitored. Any views or opinions 
presented are solely those of the author jquery-en@googlegroups.com and do not 
necessarily represent those of the company.


[jQuery] Re: Validate() and TinyMCE problem

2007-06-07 Thread Jörn Zaefferer


Luc Pestille wrote:

That was exactly what I was looking for, thanks Buchs. In my case it was the 
below, just before I call validate();

$('#admin-jobs .submit').click(function(){
if (tinyMCE){ tinyMCE.triggerSave(); }
});

I don't know if this could be integrated in to validate() itself, so that other 
people don't have to come asking/searching for the answer?
  
I guess that could work. A less-guesswork would be a custom method, 
something like this:

$.validator.addMethod(tinymce, function() {
 if(tinyMCE) tinyMCE.triggerSave();
 return true;
});

Then used in combination with other rules:
rules: {
  someField: {
tinymce: true,
required: true
 }
}

--
Jörn Zaefferer

http://bassistance.de