serialization - Howto jquery Serialize formvalue -


collecting data formfields append post script.

var datastring = 'name='+ name + '&company_name='+ company_name + '&adres='+ adres + '&zip='+ zip + '&city='+ city + '&email=' + email + '&phone=' + phone + '&message=' + message + '&imgs=' ; 

but last value imgs can multiple values added trough ajax upload script , generated dynamicly created hidden form field, dont know how pass hidden form vars datastring, can me out here?

//add uploaded file list                 if(response==="success"){                     $('<li></li>').appendto('#files').html('<input name="image" class="img" type="hidden" value="mailatt/'+file+'" /><img src="mailatt/'+file+'" alt="" width="300" /><br /><p>'+file+'</p>').addclass('success');                 } else{                     $('<li></li>').appendto('#files').text(file).addclass('error');             } 

use jquery's serialize form:

$('form').submit(function() {   alert($(this).serialize());   return false; }); 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -