I want to make one form don't do anything at all if what is submitted in the first field is shorter than 5 characters.
I got a code for a similar thing but it doesn't work on this form since the second field is hidden and it's filled by the page, so the form isn't blank when submitted.
So I want the form not do anything if when submitted what's typed on the first field is under 5 characters.
This is the form:
<form class="questionform" name="questionform-0" id="questionform-0">
<textarea class="question-box" style="width:97%;" cols="20" rows="4" id="question-box-' . $questionformid . '" name="title" onfocus="if(this.value == \'\'){this.value = \'\';}" onblur="if(this.value == \'\'){this.value = \'\';}"></textarea>
<input type="hidden" class="ubicacion" style="width:60%; font-weight:bold; border-color:white; background:white; color:white" value="<?php the_search_query(); ?> " name="question" /></p>
<div class="question-form-bottom"><input type="button" name="ask" value="Publicar" onclick="askquestion('questionform-0');"></div></form>
If it's not clear or you need more info please ask. Thanks