﻿/// <reference path="/jQuery/jquery-1.3.2-vsdoc2.js" />
/// <reference path="/jQuery/jquery.validate-vsdoc.js" />

$(document).ready(function() {
    $("#verstuur").click(function(event) {
        $.ajax({
            type: "POST",
            url: "/Default.aspx/SendMail",
            data: "{Name :'" + $('#txtNaam').val() + "' , " +
                  "Email :'" + $('#txtEmail').val() + "' , " +
                  "Message: '" + $('#txtMessage').val() + "' }",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(data) {
                $('#contacttable').html(data.d);
            }
            , error: function(data) {
                $('#status').html('Niet alle velden zijn juist ingevuld.');
            }

        });
    });
});
$(document).ready(function() {
    $("#aspnetForm").validate({
        rules: {
            txtNaam: { required: true, minlength: 2 },
            txtEmail: { required: true, email: true },
            txtMessage: { required: true, minlength: 10 }
        },
        messages:
        {
            txtNaam: " Vul uw naam in",
            txtEmail: " Vul een geldig e-mail adres in",
            txtMessage: ""
        }
    });
});

