Attempting to send some data to the following URL: "
$(function() {
var frm = $(document.myform);
var data = "?lm_po_id=154668&authentication=ThisisAuth&description=ThisIsDesc";//JSON.stringify(frm.serializeArray());
//var data = JSON.stringify(frm.serializeArray()); // Also attempted this
alert(data + "I am ready to POST this:\n\n" + data);
$.postJSON = function (url, data, callback) {
$.ajax({
'url': frm.attr("action"),
'type': 'post',
'processData': false,
'data': JSON.stringify(data),
contentType: 'application/json',
success: function (data) { callback(JSON.parse(data)); },
});
};
});
The function is called correctly, but all parameters appear as null values when checked in debug mode. Can someone please assist me in identifying what mistake I am making? Here is my HTML form
<form action="http://192.168.0.124:8080/Ilex-WS/service/ilexmobile/poImageUpload" name="myform" method="post" enctype="multipart/form-data">
<input type="text" value="158664" name="lm_po_id" /><br />
<input type="text" value="AuthCodeMD5" name="authentication" /><br />
<input type="text" value="584" name="imagenumber" /><br />
<input type="text" value="ImgName.png" name="name" /><br />
<input type="text" value="This is desc" name="description" /><br />
<input type="file" value="" name="uploadedimage" /><br />
<input type="button" value="Submit" onclick="javascript:document.myform.submit()"/><br />
</form>
Appreciate your help in advance....