Merge pull request #2630 from chillu/pulls/uploadfield-id

Conditionally send "ID" val in UploadField
This commit is contained in:
Sean Harvey 2013-10-31 14:48:18 -07:00
commit 631d313d66

View File

@ -186,13 +186,10 @@
{
formData: function(form) {
var idVal = $(form).find(':input[name=ID]').val();
if(!idVal) {
idVal = 0;
}
return [
{name: 'SecurityID', value: $(form).find(':input[name=SecurityID]').val()},
{name: 'ID', value: idVal}
];
var data = [{name: 'SecurityID', value: $(form).find(':input[name=SecurityID]').val()}];
if(idVal) data.push({name: 'ID', value: idVal});
return data;
},
errorMessages: {
// errorMessages for all error codes suggested from the plugin author, some will be overwritten by the config coming from php