If u add id on every input, u can use next js vanilla code, and add onchange function on form.
<head>
<script>
function validate(){
var submit = document.getElementById('submit');
var title = document.getElementById('title').value === ""? false: true;
var file = document.getElementById("myfile").value === ""? false: true;
var val19 = document.getElementById("in-category-19").checked;
var val20 = document.getElementById("in-category-20").checked;
var checked = val19 || val20;
var textArea = document.getElementById("textarea").value===""?false: true;
var filled =(checked && title&& textArea && file);
filled? submit.disabled=false: submit.disabled=true;
}
</script>
</head>
<body><form onchange="validate();" action="" method="post" id="submitform" /> Title:
<input type="text" id="title" name="title"> Select:
<select>
<option value="">aaa</option>
<option value="1">bbb</option>
<option value="2">ccc</option>
</select>
<br/>
<label for="myfile">Select a file:</label>
<input type="file" id="myfile" name="myfile">
<br> Description:
<textarea id ="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="submit" id="submit" disabled=true />
</form>
</body>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…