Jump to content

fusweb

Members
  • Posts

    4
  • Joined

  • Last visited

fusweb's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I've managed to get this working but my JS is not skilled at all. This works but is probably not coded very well. function Validate() { var Version_Date = document.getElementById("InsertRecordVersion_Date").value; var ValidChars = "0123456789"; var IsNumber=true; var Char; for (i = 0; i < Version_Date.length && IsNumber == true; i++) { Char = Version_Date.charAt(i); if (ValidChars.indexOf(Char) == -1) { alert("Non-Numeric Version Date"); IsNumber = false; } else { var Version_Date = document.getElementById("InsertRecordVersion_Date").value; var URN = document.getElementById("InsertRecordURN").value; document.getElementById("InsertRecordConcat_URN").value = URN + "_" + Version_Date; var MM = Version_Date.substr(0,2) var YY = Version_Date.substr(2,2) document.getElementById("InsertRecordLogical_Date").value = YY + MM; } } return IsNumber; } document.getElementById("caspioform").onsubmit=Validate;
  2. Hi, I've created a script that takes a 'MMYY' date in a string (Version_Date) and creates a new field in 'YYMM' format (Logical_Date). The input has to be a string not a number (to capture leading zeros such as 0612). I need to add some validation to check if the 'Version_Date' field (MMYY) is numeric, if not - alert the user and then return to the submission form. If the string is numeric then the JS continues and switches MMYY to YYMM etc. The JS is as follows function concatenate() { var Version_Date = document.getElementById("InsertRecordVersion_Date").value; '''''''''''''''''''''''''''''''''''''' I'm guessing the validation needs to go here somehow :/ var URN = document.getElementById("InsertRecordURN").value; document.getElementById("InsertRecordConcat_URN").value = URN + "_" + Version_Date; var MM = Version_Date.substr(0,2) var YY = Version_Date.substr(2,2) document.getElementById("InsertRecordLogical_Date").value = YY + MM; } document.getElementById("caspioform").onsubmit=concatenate; Any assistance / comments very welcome. Thanks Mat
  3. Apologies for the delay in posting back. Many thanks for this code - it worked just fine.
  4. Hi, very new to Caspio and would appreciate any assistance. I need to generate a dialogue box when a dropdown is changed to a certain condition. Dropdown field name is 'Status'. When 'Closed' is selected from dropdown I need a pop-up to appear and display a warning box along the lines of 'This job will be closed when form is submitted'. The box just needs an 'OK' as it's simply a warning to the user. Thanks in advance Kind regards Mat
×
×
  • Create New...