• I want to call a specific function with a button click.
    I have created the function and tested it within a new template but I do not want it to run when opening the page. I want to be able to add a button and to run the function when clicking it.

    Please help ??

    //Eva

Viewing 2 replies - 1 through 2 (of 2 total)
  • If your button is in a form then add a hidden form field. When the button is pressed the value of that form field is posted. Have you form post to the same page and then you can check on that page whether the form field has been posted. If it has include your function, if not show the page as normal.

    Thread Starter Kreateva

    (@kreateva)

    Sorry but that gave more questions than answers.

    No it is not within a form.
    My thought was that to add a button on a page and call the function when clicking the button.

    If someone has the solution for this, please attach both code and explanation. Code is easier to understand sometimes.

    Thanks for your effort.

    //Eva

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to call a function with button click’ is closed to new replies.