New Landing How can we help? Atelier Calling Javascript on a Button

Viewing 5 posts - 1 through 5 (of 5 total)
  • Posted in: Atelier
  • #191670
    aerosum
    Member
    Post count: 35

    Hi,

    I have created a button using your shortcode.

    I am not able to call a javascript function through it. It is just not taking the onclick= field when I add it manually inside the function shortcode. It is also ignoring the id attribute which I give it so I can use jquery or javascript written somewhere else to make this button execute a javascript code.

    I went through all the fields of the shortcode generator but there no field where I can give it an id or call a JS function directly.

    Can you please help me here.

    Thanks in Advance

    #191860
    David Martin – Support
    Moderator
    Post count: 20834

    Hey!

    Could you please supply a WP login credential for us and post a link to your site or page in question for us to investigate?

    A likely work around will be to copy the generated HTML for the button from the front-end of your website and add in your required custom JS.

    Thanks.

    #191941
    aerosum
    Member
    Post count: 35

    I could figure it out 🙂

    The trick is that you have a placeholder called link=”(URL)” in your button shortcode.

    Just add link="javascript:yourJsFunction()" as the URL.

    Best Regards

    #191944
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Great. Thanks for sharing it.

    -Rui

    #191954
    David Martin – Support
    Moderator
    Post count: 20834

    Thanks, good tip for anyone else for the future.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register