• Resolved oekoplatt

    (@oekoplatt)


    Is it possible to add an additional action which is executed if the “Continue to step 2” (or “Continue to step 3”) is clicked?
    If yes, how to achieve it?

    Than you in advance

Viewing 11 replies - 1 through 11 (of 11 total)
  • You can look into using conditional elements: https://kb.htmlforms.io/conditional-elements/

    It’s not exactly what you asked for, but maybe close enough.

    Thread Starter oekoplatt

    (@oekoplatt)

    Thank you for answer. You are right, this is not what I asked for.
    What I want to do:
    In first step fill a hidden field with a value, which is generated by a self defined shortcode and send this value in a mail to the user when he click “Continue to step 2”. I can’t use the standard send button because I need it later to send another mail.
    As hoped to find a combination of given solutions I already read knowledge base and also the description of Conditional elements, but I didn’t find what I looked for.

    By the way: Is it possible to fill a hidden field with the value from a shortcode (or with the result of a self defined function)?

    Thread Starter oekoplatt

    (@oekoplatt)

    Hi Lap,
    thank You for the answer. I use multi-step-form.html already. Otherwise I couldn’t ask for a action associated with “Continue to step 2” (as it is part of <button type="button" name="_STEP" value="2">Continue to step 2</button>).
    Have you any other suggestion?

    What kind of action do you want to associate with it?

    <button type="button" name="_STEP" value="2" onlclick="some js code here; return true;">Continue to step 2</button>

    Thread Starter oekoplatt

    (@oekoplatt)

    See above:
    I want to send a email to [EMAIL] (address of the user) which contains the value of a hidden field.
    Concerning programming I’m a newbie, but I think that I have to use wp_mail(), not js.

    Ah ok, now i get it.

    You would indeed need to write some PHP code to make that work the way you describe.

    Would it be an option to set up 2 separate HTML forms, and set the “Redirect to URL after successful sign-ups” of the first form to redirect to the second form on another page?

    Thread Starter oekoplatt

    (@oekoplatt)

    I think, it wouldn’t.
    All data are collected in first step and should be send by button [SEND] of the second step. So, if divide all into two forms, the data had to be passed from first form to mail of the second.
    The plugin “Contact Form 7 Multi-Step Forms” use cookies for it, but I want to avoid cookies. On the other hand: How to set cookie only using javascript?

    How to set cookies with JS: https://www.w3schools.com/js/js_cookies.asp

    I suppose you would need to hire a developer to write custom code for you to make it work exactly the way you want. Such a feature is not build into HTML forms at this time.

    Thread Starter oekoplatt

    (@oekoplatt)

    Bummer!
    But there is a open question yet:
    Is it possible to fill a hidden field with the value from a shortcode (or with the result of a self defined function)? Maybe It’s possible to replace the value in the markup of “add-html-to-form-dynamically.php” by a result of my function?

    • This reply was modified 3 years, 11 months ago by oekoplatt.

    Hi,

    There is a few hooks you can look at, such as
    hf_template_tags
    https://github.com/ibericode/html-forms-code-snippets/blob/master/template-tags.php

    Or the hf_form_markup if you like to access the whole form in PHP

    Hope that helps. If you have any questions, please let me know!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘additional action for button “Continue to step 2”’ is closed to new replies.