Preview Form Result With Ajax, jQuery and API -


so have form customers can generate quote products. want them able preview quote cost before submit finalized. have api built this

sitename.com/api/cart?model=1&height=700&width=550&cable_length=1&quantity=2&finish=polished_brass&rails=4&exit=top&concealed=0 

with variables being same form element names. api retrieves number want display next form when click button.

how go doing this? i'm new ajax :/

not if question how pass form data in link or how handle returned result display it. anyway, can:

$('#myform').serialize(); 

which returns form values encoded in url form, , use on url of jquery.ajax() request:

$.ajax('sitename.com/api/cart?' + $('#myform').serialize(), {     datatype: 'html',     success: function(html) {         // result html page, paste inside "result" div:         $('#result').append(html);     } }); 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -