Jump to content

Javascript help

Recommended Posts

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 =


if(date == "")


var hour = parseFloat(document.getElementById('cbParamVirtual2').value) + parseFloat(document.getElementById('cbParamVirtual5').value);

if(hour == "12")


else if(hour == "24")


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;


Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...