Hi Beate,
Kindly follow the below steps:
1. pass the form data to the marketo action page
2. pass the formid and formname
3. pass the ret as a hidden field, then pass the attr value when document loads.
$jQ("input[name='ret']").attr('value','http://www.yourcompany.com');
Hope the above will help
Best
FaizalReza