<script>
function showUploading() {
if (document.form['form']['name'].value != "" &&
document.form['form']['city'].value != "" )) {
document.getElementById('submit') .style.visibility = "hidden";
document.getElementById('uploading').style.visibility = "visible";
}
}
</script>
With above script I'd like to verify if "name" and "city" form inputs are not empty. Somehow I can't get this working, condition is still returning false even if inputs are filled with text. Here are inputs:
<input required="required" id="name" name="name" type="text">
<input required="required" id="city" name="city" type="text">
I was also trying:
if (document.getElementById('name').value != "")
None of the above methods worked for me. Whats wrong here?