When I click a button, the following code is supposed to be executed:
<input type="submit" name="cancel" value="cancel" onclick="clear_form (); return false;" class="pure-button">
This function clears the text from the textarea and removes two buttons from the form:
function clear_form () {
$("#statement").val('');
document.submitform.submit.value = "save";
document.submitform.delete.remove();
document.submitform.cancel.remove();
}
However, when I click the button in Chrome, I receive an error message saying that clear_form is not defined. As a result, the clear_form function does not work as expected.
Uncaught ReferenceError: clear_form is not defined
I'm wondering if anyone can help me figure out what I might have missed?