set form action attribute without full url

This is what i am doing currently to set a form’s action through jQuery.

$(’#form’).attr(‚action‘,‚http://testing.com/checkout/payment‘);

 

but is there a way to do it using controllers and actions like:

url controller=checkout action=payment

without writing whole orl in jQuery?

Hi,

It depends how the jQuery is created. If it´s a seperated file that´s simply included in the template, then you won´t be able to use smarty functions. If it´s an inline script then you can use the url smarty function.

Best,
Michael

This will resolve your problems - passing the parameter via data attribute:

http://forum.shopware.com/discussion/17770/smarty-variable-in-javascript