/******************************************************************************* * Author: Geoff Moes and Robert Sheldon * Project: Begining MySQL - Chapter 17 * Module: dvdrentals.js * Date: 12/10/04 * * Description: * * This file contains the Javascript support functions for the web form * submission. * *******************************************************************************/ function doEdit(button, transactionId) { button.form.transaction_id.value = transactionId; button.form.command.value = "edit"; button.form.action = "edit.php"; button.form.submit(); } function doAdd(button) { button.form.transaction_id.value = -1; button.form.command.value = "add"; button.form.action = "edit.php"; button.form.submit(); } function doDelete(button, transactionId) { var message = "Deleting this record will permanently remove it.\r\n" + "Are you sure you want to proceed?"; var proceed = confirm(message); if(proceed) { button.form.transaction_id.value = transactionId; button.form.command.value = "delete"; button.form.submit(); } } function doCancel(button) { button.form.command.value = "view"; button.form.action = "index.php"; button.form.submit(); } function doSave(button, command) { button.form.command.value = command; button.form.submit(); }