Ok, here is what I am trying to do. I have a list on another site. I have successfully connected to the site and pulled in the list as a dropdown using soap, ajax and jquery. However, once I try and submit the new item, it gives me an error. Here is the code I am using,
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
var soapEnv =
"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
<soapenv:Body> \
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
<listName>b9ac31cc-ea35-4df1-af50-4e3fa9e86b1c</listName> \
<viewName>7E918A0F-631B-4B3B-81FD-B27C98586DC4</viewName> \
<viewFields> \
<ViewFields> \
<FieldRef Name='Title' /> \
</ViewFields> \
</viewFields> \
</GetListItems> \
</soapenv:Body> \
</soapenv:Envelope>";
$.ajax({
url: "/sites/wellness/_vti_bin/lists.asmx",
type: "POST",
dataType: "xml",
data: soapEnv,
complete: processResult,
contentType: 'text/xml; charset="utf-8"'
});
$('#addThis').bind('click',function(){
var choice = $('#chooseOrg').val();
alert(choice);
$('#ctl00_m_g_03d6c665_34ef_42f1_9e55_ae2a2560edc7_ff4_1_ctl00_ctl00_TextField').val(choice)
});
});
function processResult(xData, status) {
$(xData.responseXML).find("[nodeName='z:row']").each(function() {
//$('#chooseOrg').
$('#ctl00_m_g_83e35e85_85ae_4056_9d87_b56fe029295b_ff41_ctl00_DropDownChoice').
append($("<option></option>").
attr("value",$(this).attr("ows_Title")).
text($(this).attr("ows_Title")));
});
};
</script>
Here is the Error Screen.
If I remove the soap/ajax/and jquery it adds a new item like it is supposed to, Any Ideas??