javascript - How do I submit the value of a jQuery variable in a form? -


this should easy question.

basically have form without fields, instead want pass along data on user has done on page when clicks submit button. data simple, few integers , strings stored in various jquery/javascript variables.

however, i'm @ loss on how pass these variables along form , save in database.

should first transform them instance variables , pass along via hidden form fields? should make entire form in jquery? should do?

use ajax submit form. otherwise can modify values of form before submit. ie $('#whateverinput').val(yourvalueinavariable); run before form submit , should have new value server-side. don't think need ajax can try if want. can have hidden fields in form , modify values.

if want try ajax http://api.jquery.com/jquery.ajax/ , follow format provided ie

$.ajax({   url: "urlthatwillacceptdata",   data: { javascript object here},   success: function() {      want show success message here   } }); 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -