Wednesday, 2 April 2014

Validation Jquery

function SaveHotelRegistration() {
    var Msg = "";
    if (document.getElementById("txtHotelName").value == "") {
        Msg = Msg + "<li> Please Enter the HotelName";
    }
    if ($("#ddlRoomType").val() == "0") {
        Msg += "<li> Please Select atleast One Room Type";
    }
    if ($('#txtHoteldes').val() == "") {
        Msg += "<li> Please Enter Description";
    }
    if( $('#txtHoteldes').val() != "")
     {
        if (document.getElementById("txtHoteldes").value.length < 30) {
            Msg += "<li> Description must be greater than 30 characters";
        }
     
    }
   
   
    if (document.getElementById("txtAmount").value == "") {
        Msg += "<li> Please Enter Single day Charge";
    }
    if (Msg != "") {
        jAlert(Msg,'Alert');
    }

No comments:

Post a Comment