﻿// JScript File
var valid = false;
var test = "123";

function NoFutureDateValidate(source, clientside_arguments)
{  
    if (Date.parse(clientside_arguments.Value) <= new Date().getTime() )
    {
        clientside_arguments.IsValid=true;
    }
    else {clientside_arguments.IsValid=false};
}

function TestWebServiceValidation(sender, args)
{
    Sys.Net.WebServiceProxy.invoke("/CraftWeb/Services/ValidationService.asmx", 
        "HelloWorld", true,{}, OnValidationSucceeded(), 
        OnFailed);
    //clientside_arguments.IsValid=OnValidationSucceeded.returnValue;
    //alert(OnValidationSucceeded.returnValue);
    //valid = clientside_arguments;
    //alert(clientside_arguments.IsValid);
    //args.IsValid = valid;
    //alert(valid);
}

// This is the callback function invoked 
// if the Web service succeeded.
function OnValidationSucceeded(result, eventArgs)
{
    // Display the result.
    //valid = result;
    //alert("Success: " + valid);
    //valid.value = result;
    //valid.IsValid = result;
    //return result;
}

// This is the callback function invoked 
// if the Web service failed.
function OnFailed(error)
{
    // Display the error.    
    alert(error.get_message());
}
