• Resolved amcanulty

    (@amcanulty)


    Is the OnClick Event a script or html or other? For example, I want my OnClick Event on the button to take the user to a page and nothing is happening. I’ve tried variations of these in the OnClick Event box:

    <input type=button onClick="location.href=https://rmxassociation.org">

    • This topic was modified 5 years, 9 months ago by amcanulty.
    • This topic was modified 5 years, 9 months ago by amcanulty.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @amcanulty

    The code in your ticket has some erros, the correct one would be:

    
    <input type="button" onclick="document.location.href='https://rmxassociation.org';" value="Click Here" />
    

    Please, note that you are not submitting the form, you are redirecting the users to another page, the concepts are differents.

    Best regards.

    Thread Starter amcanulty

    (@amcanulty)

    Thank you for such a quick response! Correct, I don’t want to submit the form, I want the button to take the user to a defined page.

    It still isn’t working. I’m testing from the plug-in’s own Preview page, perhaps this is visual-only and the link won’t work until it’s on a live page?

    Plugin Author codepeople

    (@codepeople)

    Hello @amcanulty

    The button should work in both the form’s preview and live website, but I cannot be totally sure about what are you doing from your side without checking the form in action.

    Could you insert the form in a page and send me its URL, please?

    Best regards.

    Thread Starter amcanulty

    (@amcanulty)

    https://rmxassociation.org/test/

    rmxassociation.org/test/

    • This reply was modified 5 years, 9 months ago by amcanulty.
    • This reply was modified 5 years, 9 months ago by amcanulty.
    • This reply was modified 5 years, 9 months ago by amcanulty.
    Thread Starter amcanulty

    (@amcanulty)

    I’m not able to paste links due to moderator. But the link is at rmxassociation dot org slash test

    Plugin Author codepeople

    (@codepeople)

    Hello @amcanulty

    The issue is simple, you are using a button control, so, in the attribute for the onclick event, in the field’s settings, you simply should insert the piece of code corresponding to the onclick event:

    
    document.location.href='https://rmxassociation.org';
    

    and not the complete input tag.
    Best regards.

    Thread Starter amcanulty

    (@amcanulty)

    Brilliant, works now. Thank you for your speed and attention, much appreciated!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘OnClick Event format?’ is closed to new replies.