Calling JavaScript Code from a Button
Running JavaScript code when a button is clicked is straightforward with Iron Speed Designer!
- Alan Fisher, Chairman of Iron Speed, Inc.

January 24, 2006
Iron Speed Designer V3.2

Using Pass-Through Attributes
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=' '

About the Author
Alan S. Fisher
Co-Founder and Chairman of Iron Speed, Inc.

Mr. Fisher was a General Partner at Outlook Ventures, Inc., a venture capital company prior to co-founding Iron Speed, Inc. He co-founded Onsale, Inc. (now Egghead.com) and was its Chief Technology Officer from July 1994 to December 1999. He also Co-founded and was President of Software Partners, Inc, a developer and publisher of software products from August 1988 to July 1994. From April 1984 to August 1988, Mr. Fisher served as Technical Marketing Manager and Product Development Manager for Teknowledge, Inc., a developer of artificial intelligence software products. From June 1981 to April 1984, he served as a member of the technical staff for AT&T Bell Laboratories. Mr. Fisher serves on the Board of Directors of Infodata Systems Inc. (NASDAQ:INFD) an e-business consulting services company; He formerly served on the board of a number of companies including Onsale, Inc. (later Egghead.com and now Amazon.com), and FatBrain, Inc. an Internet retailer of technical and professional books.

Mr. Fisher received his B.S. in Electrical Engineering from the University of Missouri and received his M.S. in Electrical Engineering from Stanford University.



  Privacy Statement