southbeach
Programmer
Writing a PHP script using JS and AJAX to manipulate form submission.
I am using fckeditor in lieu of text area where user can enter and format detailed description or content.
JS code is used to loop through the form elements and create an array which is then passed as a parameter to a PHP script via AJAX call.
The problem I am having is that JS is not picking up the value for my fckeditor field. Now, I know that these fields are set within an IFRAME and I suspect that might be the reason. However, the field name is part of the array but not the value.
Here is my JS function
Any ideas?
Thank you all in advance for your assistance!
--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
I am using fckeditor in lieu of text area where user can enter and format detailed description or content.
JS code is used to loop through the form elements and create an array which is then passed as a parameter to a PHP script via AJAX call.
The problem I am having is that JS is not picking up the value for my fckeditor field. Now, I know that these fields are set within an IFRAME and I suspect that might be the reason. However, the field name is part of the array but not the value.
Here is my JS function
Code:
function saveLZMENU() {
var theForm = document.forms.lzmenuform;
var alertText = ""; var names = ""; var values = "";
for(i=0; i<theForm.elements.length; i++)
{
alertText += "Element Name: " + theForm.elements[i].name + " - " + theForm.elements[i].type + "<br />\n"
names += theForm.elements[i].name + '~';
if(theForm.elements[i].type == "text" || theForm.elements[i].type == "textarea" || theForm.elements[i].type == "button" || theForm.elements[i].type == "password" || theForm.elements[i].type == "hidden")
{ values += theForm.elements[i].value + '~';
} else if(theForm.elements[i].type == "checkbox") {
if(theForm.elements[i].checked) { values += theForm.elements[i].value + '~' } else { values += '~'; }
} else if(theForm.elements[i].type == "select-one") {
values += theForm.elements[i].options[theForm.elements[i].selectedIndex].text + '~'
} else {
values += theForm.elements[i].value + '~';
}
}
names += "eol";
values += "eol";
var string = names + '::' + values;
alert(alertText);
xajax_call('savelzmenu',string);
return true;
}
Any ideas?
Thank you all in advance for your assistance!
--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.