hmdnawaz Posted January 3, 2011 Share Posted January 3, 2011 I am creating a dynamic form in php. And i want to add fckeditor to this dynamic form. so any idea about to add fckeditor to a dynamically creating form in php??? Any Help please??? Link to comment https://forums.phpfreaks.com/topic/223248-how-to-add-fckeditor-to-a-dynamically-creating-form-in-php/ Share on other sites More sharing options...
litebearer Posted January 3, 2011 Share Posted January 3, 2011 show us what you have tried thus far, and what errors/problems you have encountered Link to comment https://forums.phpfreaks.com/topic/223248-how-to-add-fckeditor-to-a-dynamically-creating-form-in-php/#findComment-1154168 Share on other sites More sharing options...
hmdnawaz Posted January 4, 2011 Author Share Posted January 4, 2011 function htmlEventFormGenerator($asd){ $out = '<form id="mainform" enctype="multipart/form-data" action="index.php" method="post"><div class="eventdiv"><h2 class="contentHeading">Add Event</h2>'; ?> <div class="divInner1"> <?php include('fckeditor.php'); $oFCKeditor = new FCKeditor('description') ; $oFCKeditor->BasePath = $sBasePath ; $value2 = $oFCKeditor->Value = 'ahmad'; //$value2 = $oFCKeditor->Value; $oFCKeditor->Height = '100px'; $oFCKeditor->Create(); ?> </div> <?php $sql="SELECT title FROM events"; $r = mysql_query($sql); $out.="<label>Display on front screen</label><Input type = 'checkbox' name ='displayonfront' value= '1'/><br><br>"; $out.='<label>Parent</label>'; $out.='<SELECT name ="eventparent">'; $out .='<OPTION value="0">'."Null".'</OPTION>'; while ($row = mysql_fetch_array($r)){ $out .='<OPTION value="'.$row['title'].'">'.$row['title'].'</OPTION>'; } $out.='</SELECT>'; $zain = $_POST["date"]; echo $zain; foreach ($asd as $key => $value){ $out.= "<div><label>$value[label]</label><input type='$value[type]' name='$key' value='$value[value]'/></div> <br>"; if($key=="title"){ $out.= '<div><label>Event Date</label><input type="text" id="myDate" name="date" /><a href="javascript:NewCal(\'myDate\',\'yyyymmdd\')"><img src="images/cal.gif" width="22" height="22" border="0" alt="Pick a date"></a></div>'; } if($key=="place"){ $out.= '<div><label>Event Description</label></br></br></br></br></br></br></br></br></div>'; } } $out.= "<input type='hidden' value='$value2' name='description'></input></div></form>"; return $out; } The above function creates a dynamic form and in that function i write the code of fckeditor. The database insertion is on another page. when i run the code it only save the default value of fckeditor in database which is ahmad and not any other text entered after execution. What is the problem?? Please help me. Link to comment https://forums.phpfreaks.com/topic/223248-how-to-add-fckeditor-to-a-dynamically-creating-form-in-php/#findComment-1154525 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.