I have this javascript function that shows the submit button when a file is selected in a form.
What I would like to do with that is add to the function so it checks the value selected in the file field to see if the last 4 characters are .jpg or .JPG if so show the submit button if not show error message which can be a dive set to hidden also at the start if needed
How do I do that?
the form code that invokes the script is
and the current javascript function isCode:<input name="image_file" type="file" size="35" id="image_file" accept="image/jpeg" onchange="showDiv('submitDiv');return true;" onkeypress="return nokeys(event)">
Thanks for your helpCode:<script> function showDiv(objectID) { var theElementStyle = document.getElementById(objectID); theElementStyle.style.visibility = "visible"; } </script>



Reply With Quote

Bookmarks