Free Puzzle Questions with Answer using Java, C#, JavaScript and PHP

JavaScript - Validation

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">

    <script language="JavaScript" type="text/javascript">
        function Validate(){
            if(document.myForm.txtFullname.value == ""){
                alert("Please enter fullname first");
                return false;
            else if(document.myForm.txtEmail.value == ""){
                alert("Please enter email first");
                return false;
            //recommeded to use regex for email validation
            else if(document.myForm.txtEmail.value.lastIndexOf(".") == -1){
                alert("Please enter email correctly");
                return false;
            else if(document.myForm.selectCountry.value == "-"){
                alert("Please select country first");
                return false;
                return true;

    <form name="myForm" onsubmit="Validate()">
                <td><input type="text" name="txtFullname" /></td>
                <td><input type="email" id="txtEmail" name="txtEmail" /></td>
                    <select name="selectCountry">
                        <option value="-">-</option>
                        <option value="Ethiopia">Ethiopia</option>
                        <option value="US">US</option>
                        <option value="Canada">Canada</option>
                        <option value="Britain">Britain</option>
                <td><button> Sumbit Record</button></td>