Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #844114

    Hello,

    How can I add onclick event for a contact form button? Need to add something similar to this onclick=”do_this()” to certain forms.
    Also adding the above applies to all forms or can I apply it to certain contact forms only?

    Thanks for your time!

    #844215

    I’m trying to achieve the following:

    After user fills in name and email, clicks Download button

    <input type=”submit” id=”#” value=”Download” onclick=”get_trial()”/>

    need to trigger this function:

    <script language=”javascript”>
    function get_trial(){
    document.the_form_name.action=”http://www.site.com:/trial&#8221;;
    }
    </script>

    Also I need the form name and set the form action to action=””

    #844227

    Hi,

    Try the solution posted in this thread: https://kriesi.at/support/topic/please-clear-this-up-for-em-ga-tracking-2/#post-349057

    Best regards,
    Nikko

    #844236

    Thanks for pointing me in the right direction, this might actually work.

    Can you please let me know how I get the name of the form or assign a custom name to the form?

    • This reply was modified 7 years, 4 months ago by wmaker.
    #844450

    Hi,
    Try opening your page, then the Developers Tools (F12 – Windows) or Ctrl+Shift+I
    then find your element and look for the unique class, In my screenshot it is “avia-builder-el-4”
    2017-08-26_161535

    Best regards,
    Mike

    #844883

    Is there any option to set the form action to action=”” ? I need to send the form data to a different URL and so far anything I’ve tried won’t work…

    #844956

    Hi,

    I don’t think there’s an option for that since it will affect all other contact form. I would suggest using contact form plugins or adding the html form manually.

    Best regards,
    Nikko

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.