Ik wil mijn formulier versturen met AJAX. Ik gebruik jQuery. Ik kan één FCKEditor versturen. Echter heb ik twee editors op mijn pagina staan, daar gaat het mis. Ik krijg:
Aanmaken van mijn twee FCKeditors:
Mijn (nog heel simpele) AJAX functie:
Kunnen jullie mij op weg helpen?
code:
1
| FCKeditorAPI.GetInstance("vervolg") is undefined |
Aanmaken van mijn twee FCKeditors:
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| $sBasePath = "../fckeditor/"; $oFCKeditor = new FCKeditor('intro') ; $oFCKeditor->BasePath = $sBasePath ; $oFCKeditor->Width = 780; $oFCKeditor->Height = 300; $oFCKeditor->ToolbarSet = "Beheer"; $oFCKeditor->Value = $_POST['intro']; $oFCKeditor->Create() ; echo "<br /><br /><strong>Inhoud pagina:</strong><br />"; $oFCKeditor2 = new FCKeditor('vervolg') ; $oFCKeditor2->BasePath = $sBasePath ; $oFCKeditor2->Width = 780; $oFCKeditor2->Height = 300; $oFCKeditor2->ToolbarSet = "Beheer"; $oFCKeditor2->Value = $_POST['vervolg']; $oFCKeditor2->Create() ; |
Mijn (nog heel simpele) AJAX functie:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| var intro = escape(FCKeditorAPI.GetInstance('intro').GetXHTML()); var vervolg = escape(FCKeditorAPI.GetInstance('vervolg').GetXHTML()); var ajaxOpties = { type: "post", url: "nieuws-toevoegen.php?aktie=opslaan", data: "&titel=" + $("#titel").val() + "&actief=" + $("#actief").val() + "&intro="+intro+"&vervolg="+vervolg, success: function(data) { alert( "Ik kreeg terug: " + data ); } }; $.ajax(ajaxOpties); |
Kunnen jullie mij op weg helpen?