This probably has something to do with this part:
<input type="file" name="userfile" value="onchange="return validateFileExtension(this)"" id="file_select" />
The input type = file should not have the value = attribute (and even if so, you should not put javascript there!)
You also have javascript in the form:
onsubmit="return validateFileExtension(this.userfile)"
If the validateFileExtension() function returns false , the form will not be submitted. However, the way you wrote jQuery means that the message will still be displayed.
EDIT:
Change the identifier on the submit button to something other than send.
In jQuery docs:
Forms and their children should not use input names or identifiers that contradict form properties such as feed, length, or method. Name conflicts can cause confusing failures. For a complete list of rules and checking the markup for these problems, see DOMLint .
BUT:
You should consider @Abdul's solution, as a working submit will take you away from your message.
If you are using CodeIgniter and you do not want to use Ajax, you should use the flash function to display a message to the user after submitting the form.
source share