Jump to content

MayMusic

Caspio Evangelist
  • Content Count

    1,510
  • Joined

  • Last visited

  • Days Won

    74

MayMusic last won the day on November 14

MayMusic had the most liked content!

8 Followers

About MayMusic

  • Rank
    Advanced Member
  • Birthday May 19

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Single Status Update

See all updates by MayMusic

  1. 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>

×
×
  • Create New...