|
Running JavaScript code when a button is clicked is straightforward with Iron Speed Designer using
the pass-through attribute mechanism on the button’s Properties dialog.
To access the Properties dialog, double-click the button control in the Design tab in Iron Speed Designer.
Then, go to the Attributes tab to add a new attribute with the appropriate name and value.
The easiest way to understand this mechanism is by example.
Display a message on the browser window status bar
This example displays a message in the browser window status bar as you mouse over a button.
| Pass-Through Attribute |
Value |
| Button-HtmlAttributes-onMouseMove |
JavaScript:window.status='Press to Save Data...'; |
| Button-HtmlAttributes-onMouseOut |
JavaScript:window.status=' ' |
Display confirmation message for record deletion
You can display a confirmation dialog when the application user clicks a Delete button.
| Pass-Through Attribute |
Value |
| Button-HtmlAttributes-onClick |
JavaScript:return confirm("Are you sure?"); |
Prompt when a button is clicked
This example displays a message in the browser window status bar as you mouse over
a button a displays a confirmation dialog when the button is clicked.
| Pass-Through Attribute |
Value |
| Button-HtmlAttributes-onClick |
JavaScript:return confirm("Are you sure?"); |
| Button-HtmlAttributes-onMouseMove |
JavaScript:window.status='Press to Close...'; |
| Button-HtmlAttributes-onMouseOut |
JavaScript:window.status=' ' |
|