I would like to do with HTML or Javascript not with PHP an error message when the text is empty. I have created the code ,it is a part of my code form that has a text name.I have seen tutorials or same answers here but I wasn't able to do this.
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="jquery-1.7.1.min.js"></script>
<script>
function ValidateForm() {
if($("#onoma").val()=="") {
$("#error_msg").html("Field needs filling");
}
}
</script>
in the body parts I have this code :
<label class="required" for="onoma">Όνομα</label>
<input type="text" id="onoma" name="firstname" placeholder="Your name..">