Two Part Form Submittal

Anonymous
Not applicable

Re: Two Part Form Submittal

on this page for ex : Videojet - Marquage et Codage Industriel | Videojet

I want the form poping only once when you double click

SanfordWhiteman
Level 10 - Community Moderator

Re: Two Part Form Submittal

Well, this doesn't really have anything to do with the form itself.  You have a custom "button" (actually an <A> tag) running JS. Unfortunately, because it isn't a real button, there is no built-in way to set it to disabled so it won't respond to the second click. It is quite easy to do with JS, if you are comfortable there: given your developer's current choices (which I don't really agree with) most straightforward is :

     onclick="this.setAttribute('onclick',''); MktoForms2.loadForm..."

I would recommend instead using a real button and styling it to match the current look.  The <BUTTON> tag is sadly underused IMO.

Anonymous
Not applicable

Re: Two Part Form Submittal

OK I tried your code and it works , thanks

but there is one problem: this limits the time the form pops up to only once.

what I would like to limit is when you double click on the button - the form is not displayed twice like this : Awesome Screenshot

Dave_Roberts
Level 10

Re: Two Part Form Submittal

Ever try editing a <button> element in the Rich Text Editor? The link tool doesn't work and changing the text removes the button, it's a poor experience.

 

I had given thought to using <button> elements in lieu of <a> elements b/c they're easier to work with for scripting, but this leaves the user in a tricky spot unless things are hard-coded and variable-ized or they're comfortable going into the HTML to update text and links and stuff.

 

Do you know of a work around for editing <button>s in the RTE -- or do you think that's something that'd be a feasible improvement to suggest?

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Two Part Form Submittal


Ever try editing a <button> element in the Rich Text Editor? The link tool doesn't work and changing the text removes the button, it's a poor experience.

Not sure exactly what you mean? This seems to work OK, as long as you arrow over to the button and then click the Link tool. It's true that it doesn't work if you click the mouse, since that just clicks the button.

2021-03-08 17_53_03-Lab - button in RTA.png

 

Dave_Roberts
Level 10

Re: Two Part Form Submittal

By arrow do you mean use the directional keys (up, down, left, right)? 
I tried to setup something like you showed and took a quick screencap so you could see what's going on on my end. Im not able to see the link tool lightup in the toolbar and no amount of selected or clicking is working to load the text and link into the Insert/Edit link window. You'll notice when I highlight all the text and then click the link it picks up the text but not the URL.

Any idea what Im missing here?

 

button-RTE.gif

SanfordWhiteman
Level 10 - Community Moderator

Re: Two Part Form Submittal

<button> elements don't support the href attribute. It needs to be wrapped in an <a> (or controlled entirely via JS, but then you won't get the link popup).

Dave_Roberts
Level 10

Re: Two Part Form Submittal

Oh dear, back to the books for me... thanks for pointing this out Sanford, it'll give me a fresh place to start thinking about buttons again.

Samantha_Cossum
Level 3

Re: Two Part Form Submittal

Hi Sanford Whiteman‌,

Is there a way to do this with branching forms? We use an outside web development company and they added our Marketo forms to our site but put each step on a different page (we wanted multiple forms so we could "save" the progress if they don't finish). I was going to send this chat and you code to them so they just have the forms replace but one of our forms branches into 3 different versions based on a choice of a question.

Hope that makes sense!

SanfordWhiteman
Level 10 - Community Moderator

Re: Two Part Form Submittal

Can this be adapted to have next form in the sequence determined dynamically in the onSuccess, based on responses submitted in the previous form? Certainly!. 

Since you already have devs engaged I assume they're pro enough to get this done.