FCKeditor not pass data to the controller

27 views
Skip to first unread message

altahay

unread,
Jul 2, 2007, 7:54:50 AM7/2/07
to Castle Project Users
I have to useFCKEditor to edit posts in my application. I use a form
with a textarea where I loadFCKEditor. The form is submitted with
ajax.
Myproblem is that the modifies that I do withFCKEditor is not passed
to the controller.

Colin Ramsay

unread,
Jul 2, 2007, 8:29:16 AM7/2/07
to castle-pro...@googlegroups.com
This isn't really a Monorail problem, but try debugging your Action code and check the Request values - you may see that the values that FCK is passing has a different name than you'd expect.

altahay

unread,
Jul 3, 2007, 4:08:46 AM7/3/07
to Castle Project Users
Hi, I debugged my code and I found that all the Request values had the
expected name, but the content of the FCK request value was empty. The
name is being passing correctly but it have not data.
Any more ideas?
Thanks.

On 2 jul, 13:29, "Colin Ramsay" <colinram...@gmail.com> wrote:
> This isn't really a Monorail problem, but try debugging your Action code and
> check the Request values - you may see that the values that FCK is passing
> has a different name than you'd expect.
>

Ruprict

unread,
Jul 4, 2007, 5:53:12 AM7/4/07
to Castle Project Users
Can you post your Controller code and the Request headers?

Sean Chambers

unread,
Jul 4, 2007, 2:30:23 PM7/4/07
to Castle Project Users
I ran into the same problem with FCKEditor on a recent project. I
fiddled with it for awhile and couldnt get it to work.

In the end I used TinyMCE instead of FCKEditor. TinyMCE also has
better support for other browsers. I would suggest you take a look at
that editor instead.

http://tinymce.moxiecode.com

cheers!

Sean

On Jul 3, 4:08 am, altahay <alta...@gmail.com> wrote:

> > > to the controller.- Hide quoted text -
>
> - Show quoted text -

altahay

unread,
Jul 5, 2007, 5:03:23 AM7/5/07
to Castle Project Users
Hi!, I'll try to explain what's the problem:

that's what I have in the View:

<textarea name="Event.Observations" id="Event.Observations" cols="31"
rows="7" class="formTextmultilinea"
onchange="javascript:toggleModify('modifycheck');">$!
Event.Observations</textarea>

that's the debug code that I have in the Controller:

foreach (string input in Request.Form)
{
System.Console.WriteLine ("element:"+input);
System.Console.WriteLine
("contentent:"+Request.Form[input]);
}

In i.e if I write "Observation content" in the "Event.Observations"
text area I obtain the following:

element:Event.Observations
content:

So in the Controller, I could access to the element Event.Observations
defined in the View, but the content of Event.Observations was not
sended.

Sean Chambers

unread,
Jul 5, 2007, 10:28:04 PM7/5/07
to Castle Project Users
instead of enumerating the Request.Form can't you pass the
even.observations through the action parameters?

Colin Ramsay

unread,
Jul 6, 2007, 3:12:21 AM7/6/07
to castle-pro...@googlegroups.com
I think he's just demonstrating that there's nothing in Request.Form['Event.Observations'], in which case using an action param wouldn't work.

Though.. are you submitting the form via post?

Sean Chambers

unread,
Jul 6, 2007, 7:34:58 AM7/6/07
to Castle Project Users
would the naming of the id have anything to do with it? I mean by
there being a "." in the id of his field? Have you tried it with a
different name/id?

probably not, but I can't think of any other reason it wouldnt be in
there.

Colin Ramsay

unread,
Jul 6, 2007, 7:43:38 AM7/6/07
to castle-pro...@googlegroups.com
the id doesn't affect what's posted. And the  "." is ok cos that's used in MR all over the place to support the databinding prefix.

Sean Chambers

unread,
Jul 6, 2007, 9:46:16 AM7/6/07
to Castle Project Users
this is strange then. I would be interested to know whats happening
here.

You said your're submitting the form with Ajax. Can we see the how
your submitting it with ajax? Are you using a custom js function to do
that?

Also,

can you submit via normal post with it working? then that would point
to ajax being the problem

i think im clutching at straws =P

altahay

unread,
Jul 6, 2007, 11:25:41 AM7/6/07
to Castle Project Users
Hi

that's the ajax submit:

<form onsubmit="new Ajax.Updater('dia', '/schedule/checkoverlap.
$EXTENSION', {onLoading:function(request)
{ javascript:waitPointer('schedule') } , onComplete:function(request)
{ javascript:defaultPointer('schedule'); setGreaterHeight('lateral',
'central'); } , asynchronous:true, evalScripts:true,
parameters:Form.serialize(this)}); return false;" enctype="multipart/
form-data" name="newEvent">

and that's the submit button:

<input type="submit" value="$l10n.SEND"
onclick="javascript:alert(document.getElementById('Event.Observations').value);">

but I found something new:

If you look at the submit button code I put an alert to debbug the
textarea, the alert have no data... so.. now I don't think that the
problem were between the View and the Controller... the data was lose
previously...

What do you think?

Colin Ramsay

unread,
Jul 6, 2007, 11:31:07 AM7/6/07
to castle-pro...@googlegroups.com
Is that definitely submitting by POST?

This isn't anything to do with Monorail btw, so you might have better luck on the FCKEditor forums. And I'd suggest taking a look at some unobtrusive javascript material.

Hamilton Verissimo

unread,
Jul 6, 2007, 11:37:17 AM7/6/07
to castle-pro...@googlegroups.com
For ids, we replace . by _
But yes, that wouldnt be the source of the problem.


--
Cheers,
hamilton verissimo
ham...@castlestronghold.com
http://www.castlestronghold.com/

Sean Chambers

unread,
Jul 6, 2007, 11:58:55 AM7/6/07
to Castle Project Users
try adding method: 'post', after your parameters:Form.Serialize(this)

I know in one instance I was having a problem with that and had to
tell it what method to use.

On Jul 6, 11:25 am, altahay <alta...@gmail.com> wrote:
> Hi
>
> that's the ajax submit:
>
> <form onsubmit="new Ajax.Updater('dia', '/schedule/checkoverlap.
> $EXTENSION', {onLoading:function(request)
> { javascript:waitPointer('schedule') } , onComplete:function(request)
> { javascript:defaultPointer('schedule'); setGreaterHeight('lateral',
> 'central'); } , asynchronous:true, evalScripts:true,
> parameters:Form.serialize(this)}); return false;" enctype="multipart/
> form-data" name="newEvent">
>
> and that's the submit button:
>
> <input type="submit" value="$l10n.SEND"

> onclick="javascript:alert(document.getElementById('Event.Observations').val­ue);">

> > > > > > > - Show quoted text -- Hide quoted text -

Fábio Batista

unread,
Jul 15, 2007, 10:44:08 PM7/15/07
to castle-pro...@googlegroups.com
The dot is OK for MonoRail, but maybe not for FCKEditor. Please try
removing the dot.

On 7/6/07, Colin Ramsay <colin...@gmail.com> wrote:


--
Fábio David Batista
fabio.dav...@gmail.com
http://nerd-o-matic.blogspot.com

Dan Bunea

unread,
Jul 18, 2007, 7:54:14 AM7/18/07
to castle-pro...@googlegroups.com
Hi,

We use FCKEDitor and MR, with fields with dot. For example look here: http://www.eptala.ro/cms20demos/jobspage.htm

We've discovered that FCK doesn't sent the value if you submit a form trough ajax (something to do with form.serialzise in prototype). However normal html forms have no problem, even if the name contains dot (module.Content for example) and databinding works great.

Thanks,
Dan

Reply all
Reply to author
Forward
0 new messages