So I have a few inputs that the user must fill out before they can submit. How can this be done with the following text input and select element?
<input id="project_input" type="text" name="peer_project" onclick="this.value='';" onmousemove="enable_submit();" value="What project was this?" />
<select name="peer_group"><option value="What group did you belong to?">What group did you belong to?</option><option value="group_1">Group 1</option><option value="group_2">Group 2</option></select>
I had some JavaScript that I was working on for the “enable_submit()” function in the above text-box, but as can be expected, it didn’t work. It would activate the submit upon mouseover regardless of what was in the input at that moment. I would love to know what I did wrong with it (see below):
function enable_submit(){
if((document.getElementById("project_input").value != 'What project was this?') || (document.getElementById("project_input").value != '')){
document.getElementById("submit").disabled = false;
}
}