Jump to content

DavidKennett

Members
  • Content Count

    8
  • Joined

  • Last visited

Everything posted by DavidKennett

  1. Thank you for that script. I've added that, but it doesn't seem to have had any effect. I can still select a date in the future via the time/date field and it allows me to submit the submission form.
  2. I have the same issue where i have implemented the below script but it is still allowing me to select a date in the future from the date/time. <script> function pastDateValidation() { var d=document.getElementById("InsertRecordClient_AML_Date").value; if(new Date(d) > new Date()) { alert("Select a date which is before now"); document.getElementById("InsertRecordClient_AML_Date").value=""; } } document.getElementById('InsertRecordClient_AML_Date').onchange = pastDateValidation; </script> I've
  3. Following on from the above, is it possible to some how do a tally on which fields have been answered so that i can do a % completion for each of my forms. I use a mixture of submission forms and reports.
  4. Thank you for the reply. I have checked those three things and still am allowed to enter a date in the future using the time/date field type. I've been by support that because i'm in UK localization the script may need changing. It works in US localization. Would you know what i would need to change for it to work in UK localization please?
  5. Hi MayMusic you seem to have good experience with Caspio and perhaps adding JS. I wonder if you can help on a couple things please.

    I have tried the following JS where my table field is called Files, but this is still allowing me to upload a image file like PNG. Any advice please?

    <SCRIPT LANGUAGE="JavaScript">
    document.getElementById("Files").setAttribute("accept","application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
    </SCRIPT>

    and 

    I  have implemented the below script but it is still allowing me to select a date in the future from the date/time field type.

     

    <script>
    function pastDateValidation()
    {
        var d=document.getElementById("InsertRecordClient_AML_Date").value;
            if(new Date(d) > new Date())
        {
            alert("Select a date which is before now");
            document.getElementById("InsertRecordClient_AML_Date").value="";
        }

    }
    document.getElementById('InsertRecordClient_AML_Date').onchange = pastDateValidation;

    </script>

     

    Any help you can give on either of these would be fab. 

     

    many thanks

    David

    1. DavidKennett

      DavidKennett

      Hi MayMusic,

      I've implemented the below JS in a HMTL block however it is still allowing me to use the date picker and select a date in the future.

      Would you have any advice please.  

      <script>
      function pastDateValidation()
      {
          var d=document.getElementById("InsertRecordClient_AML_Date").value;
              if(new Date(d) > new Date())
          {
              alert("Select a date which is prior to today.");
              document.getElementById("InsertRecordClient_AML_Date").value="";
          }
       
      }
      document.getElementById('InsertRecordClient_AML_Date').onchange = pastDateValidation;
       
      </script>

  6. Following on from the below post I have the same issue where i have implemented the below script but it is still allowing me to select a date in the future from the date/time. <script> function pastDateValidation() { var d=document.getElementById("InsertRecordClient_AML_Date").value; if(new Date(d) > new Date()) { alert("Select a date which is before now"); document.getElementById("InsertRecordClient_AML_Date").value=""; } } document.getElementById('InsertRecordClient_AML_Date').onchange = pastDateValidatio
  7. I am trying to only allow specific file type upload using JS <SCRIPT LANGUAGE="JavaScript"> document.getElementById("Files").setAttribute("accept","application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); </SCRIPT> Where 'Files' is the table field name. But it still allows me to upload a PNG file. Am i doing something wrong?
×
×
  • Create New...