Adding a js function to a form Cancel button
Jamroom Developers
Thanks Michael!
elseif (isset($cancel_url) && strlen($cancel_url) > 1) {
$html .= ' input type="button" id="' . $_form['form_params']['name'] . '_cancel" class="form_button" value="' . $cancel_value . '" onclick="' . $cancel_url . '" ';
}
// and cancel button
if ($cancel_value || $cancel_url) {
if (!$cancel_value) {
$cancel_value = $_lang['jrCore'][2];
}
if ($cancel_url == 'referrer') {
$cancel_url = jrCore_get_local_referrer();
}
if ($cancel_url == '$.modal.close();') {
$html .= ' ';
}
elseif (jrCore_checktype($cancel_url, 'url')) {
$html .= ' ';
}
else {
$cancel_url = jrCore_get_last_history_url();
$html .= ' ';
}
$cancel = "myModule_update_div();";
$_tmp = array(
'submit_value' => '13,
'cancel' => $cancel,
'values' => $_rt
);
jrCore_form_create($_tmp);