Forum Moderators: open
Currently, the JavaScript executes, focusing on the faulty input but them immediately submits....
Here is my code:
function submit_check()
{
var form = document.form1;
var returnValue = false;
if (form.title.value.length == 0)
{
var logo_title = document.getElementById('logo_title');
logo_title.style.color = 'Red';
form.title.focus();
}
else
{
returnValue = true;
}
return returnValue;
}
<form name='form1' id='form1' >
<div id='leftColumn'>
<fieldset>
<legend id='logo_title'><span>*</span> Title of Your Listing:</legend>
Text Title:<br />
<input type='text' name='title' size='30' maxlength='70' value='' /><br />
    - OR -<br />
Image Logo<br />
<input type='file' name='fileImgLogo' size='30' value='' />
<p id='error_enterLogo'>Something something error message.</p>
</fieldset>
<input type='submit' name='submit' value='Next ->' onclick='submit_check()' />
</div>
</form>
I've tried clearing the fields with element.value = ''; but this wont work with the file input.
Fooling around with it, I have found that in IE it won't let you correct the file input then submit. You can use the brows button, then it will submit. Is this a bug? Anyone know a work around?