Hello,
I am currently trying to use form validation using PHP in conjunction with FCKEditor.
I am doing this by posting the form to itself, then checking each field value using the $_POST command.
If the form passes validation,the form is submitted to a MYSQL database, if the form does not pass validation the form is displayed with the error message and each field is populated with field values.
When I submit the form without validation errors everything submits properly and the data is displayed correctly.
But, if a field fails validation the TextArea with FCKEditor loses formatting, Mainly font colour and font size, bolding works fine.
I have included the html source from the FCKEditor below to show what I mean.
Source before validation
<p><span style="font-size: medium;"><span style="color: rgb(255, 0, 0);"><span><strong>this is a test</strong></span></span></span></p>
<p> </p>
<p>test</p>
Source after validation
<p><span style=""><span style=""><span><strong>this is a test</strong></span></span></span></p>
<p> </p>
<p>test</p>
Has anybody else had this issue? How did you resolve it?
I am currently trying to use form validation using PHP in conjunction with FCKEditor.
I am doing this by posting the form to itself, then checking each field value using the $_POST command.
If the form passes validation,the form is submitted to a MYSQL database, if the form does not pass validation the form is displayed with the error message and each field is populated with field values.
When I submit the form without validation errors everything submits properly and the data is displayed correctly.
But, if a field fails validation the TextArea with FCKEditor loses formatting, Mainly font colour and font size, bolding works fine.
I have included the html source from the FCKEditor below to show what I mean.
Source before validation
<p><span style="font-size: medium;"><span style="color: rgb(255, 0, 0);"><span><strong>this is a test</strong></span></span></span></p>
<p> </p>
<p>test</p>
Source after validation
<p><span style=""><span style=""><span><strong>this is a test</strong></span></span></span></p>
<p> </p>
<p>test</p>
Has anybody else had this issue? How did you resolve it?
Re: Help - I lose formatting in FCKEditor when I try form valida
I've checked my database and the <span style="color: rgb(255, 0, 0);"> was successfully entered to the database, but not loaded on the $oFCKeditor->Value
also on the displaying page I use this code to get the data
and on the div that displays
what appeared is the just the default font with no formatting color & font at all ( except for heading, I don't know why it worked )
I am a newbie in php & mySQL so there must be something I've missed which needs help,
thx
Re: Help - I lose formatting in FCKEditor when I try form valida
Solved my problem using this code for the displaying page