Hi all, Im sure I'm off somewhere with syntax but I get strange
behavior with this script. sometimes it does the .post sometimes it
doesnt. On top of that it doesnt return the alert if the post is
successful or not. Is it better to use .ajax?


function Validate() {
  if($('#title').val() == ""){
    alert("You must enter a title for the event.");
    return false;
  }else{
    CopytoCal();
  }
}

/* function to copy an entry to another calendar */
function CopytoCal() {
   var cnm = 'Theatre Calendar';
   var purl = 'http://10.1.3.20/theatrcalendar/webCal3_updated.asp';
   $.post(purl,$("#event").serialize(),function(data,status){
     if (status =="success") {
       alert("Record added/updated! Entry has been copied to the " +
cnm + ". You should still check and make sure the entry has been
copied.");
     } else {
       alert("There was an error! The entry was NOT copied to the " +
cnm + ".")
     };
   });
}

Reply via email to