TannerCarter Posted October 28, 2011 Report Share Posted October 28, 2011 In the program below, if no date is entered, the program assigns the date of "01/01/2011". Instead, I don't want to edit the record (I want the script to stop). How do I do this? document.getElementById('caspioform').onsubmit = function(){ var date = document.getElementById('cbParamVirtual1').value; if(date == "") date="01/01/2011"; var hour = parseFloat(document.getElementById('cbParamVirtual2').value) + parseFloat(document.getElementById('cbParamVirtual5').value); if(hour == "12") hour="00"; else if(hour == "24") hour="12"; var minute = document.getElementById('cbParamVirtual3').value; if(minute == "") minute = "00"; document.getElementById('EditRecordPick_Up_Date').value = date + " " + hour +":"+ minute; var pickup_date = document.getElementById("EditRecordPick_Up_Date").value; } Quote Link to comment Share on other sites More sharing options...
ShWolf Posted November 2, 2011 Report Share Posted November 2, 2011 Hi, It's not clear. Could you give more information? What should happen if there is no value in the Date field and what should be when there is a value? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.