Jump to content

tbourgeois

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. Thank you May Music, This is what I ended up with. What do you think? .............................................................................................................................. <SCRIPT LANGUAGE="JavaScript"> document.getElementById('caspioform').onchange = function(){ //This takes the date and time and concatenates into one variable //!!! If on submission form use 'INSERT' record //!!! if on management form use 'EDIT' record // Date var dt1 = document.getElementById('cbParamVirtual1').value; var dt2 = document.getElementById('cbParamVirtual5').value; // hours var hr1 = document.getElementById('cbParamVirtual2').value; var hr2 = document.getElementById('cbParamVirtual6').value; // Minutes var mn1 = document.getElementById('cbParamVirtual3').value; var mn2 = document.getElementById('cbParamVirtual7').value; //Seconds var seconds = "00"; var ampm1 = document.getElementById('cbParamVirtual4').value; var ampm2 = document.getElementById('cbParamVirtual8').value; var dateAndTime1 = dt1 + " " + hr1 + ":" + mn1 + ":" + seconds + " " + ampm1; var dateAndTime2 = dt2 + " " + hr2 + ":" + mn2 + ":" + seconds + " " + ampm2; // First date/time field if (dt1 !== "" && hr1 !== "" && mn1 !== "" && ampm1 !== "" ) { document.getElementById('InsertRecordStart_Date_and_Time').value = dateAndTime1; } else { document.getElementById('InsertRecordStart_Date_and_Time').value = ""; } // Second date/time field if (dt2 !== "" && hr2 !== "" && mn2 !== "" && ampm2 !== "" ){ document.getElementById('InsertRecordEnd_Date_and_Time').value = dateAndTime2; } else { document.getElementById('InsertRecordEnd_Date_and_Time').value = ""; } }; </SCRIPT> ....................................................................................................................................................... Thanks, Tyler
  2. Hello, I am trying to edit the Java Script in the footer of a Submission Form to allow me to Concatenate Two separate Date/Time Fields. The first is a "Trip Start Date and Time" and the Second is a "Trip End Date and Time" as shown in the following attachment: The issue I'm having is that I can make one operate correctly when alone in the footer but not when I add the second. It was suggested to me that the issue may lie in the "getElementById" function and having it "defined twice" and that one may be overwriting the other. Attached are two snips of the code I have in the footer: , I need to accomplish this in a Gallery Report Data Page as well. Any thoughts? Thank you, Tyler
×
×
  • Create New...