In my form, I want to include the form only when all fields (and the list of radio buttons) have been selected.
So far, I have successfully made a submit button enablewhen the field titlehas content with:
onkeyup="if(this.textLength != 0) {subnewtopic.disabled = false} else {subnewtopic.disabled = true}"
My goal is to enable the submit button only once all . How to do it?
Here is my complete code with working jsfiddle :
<form action="" method="post" id="subnewtopicform" />
Title:
<input type="text" name="title" onkeyup="if(this.textLength != 0) {subnewtopic.disabled = false} else {subnewtopic.disabled = true}">
<br/>
Description:
<textarea name="description"></textarea>
<br/>
Category:
<ul class="list:category categorychecklist form-no-clear" id="categorychecklist">
<li id="category-19"><label class="selectit"><input type="radio" id="in-category-19" name="category" value="19"> Animation</label></li>
<li id="category-20"><label class="selectit"><input type="radio" id="in-category-20" name="category" value="20"> Anime</label></li>
</ul>
<input type="submit" value="Submit Topic" class="button-primary" name="subnewtopic" id="subnewtopic" disabled="disabled" />
</form>
source
share