﻿function retailerRegister(securecode) {
    var param = "";
    var err = false;
    if ($('#txtRetailerSecure').val() == securecode) {
        $('#retailercontainer :input').each(function() {
            if (this.value == "") {
                err = true;
            }
            else {
                param += "&" + this.id + "=" + this.value;
            }
        });
        if (err == true) {
            alert("All field must be filled in");
        }
        else {
            $.ajax({
                type: "POST",
                url: "handle/RegisterRetailer.ashx",
                data: "act=RegisterRetailer" + param,
                async: false,
                success: function(msg) {
                    alert(msg);
                    $('#retailercontainer').hide();
                }
            });
        }
    }
    else {
        alert("Invalid validation code");
    }
}