﻿function claimDragonicaGold(securecode) {
    var param = "";
    var err = false;
    if ($('#txtSecure').val() == securecode) {
        $('#ClaimGold :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/DragonicaClaimGold.ashx",
                data: "act=DragonicaClaimGold" + param,
                async: false,
                success: function(msg) {
                    alert(msg);
                }
            });
        }
    }
    else {
        alert("Invalid verification code");
    }
}