kaushal's avatar

I have some questions regarding following in php

what is client side validation

0 likes
2 replies
jlrdw's avatar

@kaushal Just example:

<script>

$(function() {

$("#addform").submit(function(e){
    vartitle = $("#title").val();
        if(vartitle == ""){
            alert("title required");
            e.preventDefault();
            return false;
        }
        return true;
    });

});

</script>	

So submitting doesn't happen if title is blank in this case.
    

siangboon's avatar

client side validation is relied on the client side media, usually internet browser, the browser can help on validation base on a pure html attributes such as min, max, required, input type an so on... but it's limited, hence javascript is the most common tool to allow you to do full validation as you like....

howerver, client side validation is not enough, it provide better user experience and it help to reduce the server load but it does not secure at all, hence server side validation is always and the most important part to protect your application....

Please or to participate in this conversation.