I am using a form to build up some xml that gets post off to php for handling.
I am bring in an empty xml template into a textarea ( display:none ) and attempting to update some of the node values based on values from the form.
The issue is I cannot update the text for the discription node and have the updated version passed to the ajax post.
//add site form processing
$("#form1").validate({
errorLabelContainer: $("div#form1"),
messages: {
description:"Enter a name<br>",
},
submitHandler: function() {
var xmlData = $("textarea#siteData").text();
$(xmlData).find("description").text($(#description).val());
$.ajax({
type: "post",
url:"data.php",
contentType:"application/xml",
headers: {"action":"create"},
data: $("textarea#siteData").text(),
dataType: "xml",
success: function(response) {
var id = $(response).find("id").text();
if (id != "no") {
// $(location).attr("href","<?php echo $_SERVER['PHP_SELF'] ?>");
}
}
})
}
});
// END Site