Hi, I've been using the form plugin to process some data in a form and was working perfectly until I added a new input (type="file") to upload images, for some reason now the plugin wont go past the beforeSubmit: section, the weird thing is that if I change the field type to text it works perfectly.
Is it something I'm doing wrong? Or do I have to do something else with file type fields? Here's the code, any help will be appreciated , thanks in advance!!
$('#add_form_mercancia').ajaxForm({
beforeSubmit: function (){
if ($("#add_form_mercancia").valid()==false){
return false;
}
alert($("#add_form_mercancia").valid()); // <---- Outputs true
},
success: function(r){
alert(r); // <----- Does nothing
if (r){
jAlert(r, 'Error');
$.fn.colorbox.close();
}else{
$('#table_div').load('mercancia.async.php?async=1','',tableSort); //Actualizar tabla
$.fn.colorbox.close();
}
},
error: function(r){
jAlert('Error procesando el formulario ->'+r,'Error');
}
});