Aqui pongo el array y el como yo creo que tengo que hacerlo
Código HTML:
$(function(){ //original field values var field_values = { //id : value 'username' : 'username', 'password' : 'password', 'cpassword' : 'password', 'firstname' : 'first name', 'lastname' : 'last name', 'email' : 'email address' }; //inputfocus $('input#username').inputfocus({ value: field_values['username'] }); $('input#password').inputfocus({ value: field_values['password'] }); $('input#cpassword').inputfocus({ value: field_values['cpassword'] }); $('input#lastname').inputfocus({ value: field_values['lastname'] }); $('input#firstname').inputfocus({ value: field_values['firstname'] }); $('input#email').inputfocus({ value: field_values['email'] });
Código HTML:
var fields = new Array( $('#username').val(), $('#password').val(), $('#email').val(), $('#firstname').val() + ' ' + $('#lastname').val(), $('#age').val(), $('#gender').val(), $('#country').val() );
Código HTML:
$.ajax({ type: "POST", url: "guardar.php", data: AQUI NO SE QUE PONER, success: function(){ alert('Data sent'); } });//send });