Skip to main content

Adding Buttons to the Form

Next, we add buttons to the form to support saving and deleting contacts. The buttons are Zen button components.

Add the following code to the bottom of the form, immediately before the closing </form> tag.


 <hgroup>
  <button caption="Save" onclick="zenPage.saveContact();" />
  <spacer width="5"/>
  <button caption="Delete" onclick="zenPage.deleteContact();" />
</hgroup>      

Note the onclick attribute of each of the elements. Each attribute specifies the event-handler for clicks of its button. In each case the event-handler is a client-side JavaScript function. We add these functions to HomePage.cls on subsequent pages.

FeedbackOpens in a new tab