I have a textbox with default value “Keywords”. Note that this field is not required.
<input
type="text"
maxlength="255"
class="cat_textbox"
id="keyword_box"
name="keyword_box"
value="Keywords"
onblur="if (this.value == 'Keywords') {this.value = '';}"
onfocus="if (this.value == 'Keywords') {this.value = '';}" />
What I would like to happen is that when I click on the submit button, before data gets submitted, some JS would check if value of “keyword_box”=”Keywords”. If yes, then clear out that value and then submit.
add this to your submit button text input..
onsubmit=clearDefaults()in your js —