Question
Adding a second button to a form
I have a need to add a second button to a form - we have a situation where someone can order a product now, or save the product configuration they have made and learn more about our product. I'm following the instructions on this page:
http://developers.marketo.com/documentation/websites/forms-2-0/
example #5:
5. Submit a form based on a click event on some other element or event that is not part of the form. View Example
//load the form normally.
MktoForms2.loadForm("//app-sjst.marketo.com", "785-UHP-775", 1057);
//find the button element that you want to attach the event to.
var btn = document.getElementById("MyAlternativeSubmitButtonId");
btn.onclick = function(){
//When the button is clicked, get the form object and submit it.
MktoForms2.whenReady(function (form){
form.submit();
});
};
but it doesn't seem to be working. Here's the page I developed:
http://www.cochlearcommunity.com/build-your-own/n6upgrade/BYO-form.html
I've managed to position the <div> with the "second button" so that it appears to the right of the button in the form, but the code doesn't seem to be working.
Anyone had experience with this? Any examples?
Any help greatly apprecaited.
Thanks
John
*
http://developers.marketo.com/documentation/websites/forms-2-0/
example #5:
5. Submit a form based on a click event on some other element or event that is not part of the form. View Example
//load the form normally.
MktoForms2.loadForm("//app-sjst.marketo.com", "785-UHP-775", 1057);
//find the button element that you want to attach the event to.
var btn = document.getElementById("MyAlternativeSubmitButtonId");
btn.onclick = function(){
//When the button is clicked, get the form object and submit it.
MktoForms2.whenReady(function (form){
form.submit();
});
};
but it doesn't seem to be working. Here's the page I developed:
http://www.cochlearcommunity.com/build-your-own/n6upgrade/BYO-form.html
I've managed to position the <div> with the "second button" so that it appears to the right of the button in the form, but the code doesn't seem to be working.
Anyone had experience with this? Any examples?
Any help greatly apprecaited.
Thanks
John
*