Trying to post some data at 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 tried this
alert(data + "I am about 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)); },
});
};
});
This call the right function properly but when i check it in debug mode all parameters have null values, can some one help me what wrong i am doing. 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>
Thanks in advance....