View Single Post
Old 03-14-2013, 03:14 AM   PM User | #10
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,056 Times in 4,025 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Nope, that won't come close to working.

You can't use document.write() in an AJAX function. You can't use it in *ANY* code that executes after the page is fully loaded. Period.

Once again, if you are going to use AJAX, why not connect it to ASP.NET code and thus to a database??

Code:
function checkForHoliday( dateToTest )
{
    jQuery.get('isHoliday.aspx?date=' + dateToTest, function (data) 
    {
        if ( data == "YES" ) { ...set your radio button to holiday... }
    });
}
And then have a dirt simple ASP.NET page that gets that date in its querystring, checks it against a calendar of holidays, and returns nothing but "YES" or "NO".
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote