This is a migrated thread and some comments may be shown as answers.

Button triggered on page load?

1 Answer 207 Views
Button
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 29 May 2014, 09:11 PM
Hello, I am trying to create a button function for my HomeController, and it works, however, the script immediately triggers on page load. I dont want it to trigger on page load, but instead, when the user presses the button. any idea of how to fix this?

Here's the script snippets.

http://hastebin.com/legemenoyu.coffee

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 30 May 2014, 11:01 AM
Hi Alex,

When you specify the click handler with the closing brackets it will be auto executed when the page loads. In order to pass arguments to the click handler you can do it via HTML attributes. Please check the attached example.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Button
Asked by
Alex
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or