Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Reputation Activity

  1. Like
    abitaquest reacted to IMDora in JS Date Restrictions Quit Working   
    There's a possibility that the reason it's not working now is because of the recent Caspio update. Event like onsubmit will no longer be supported and you need to use Caspio's built-in event handlers. Kindly please check the link below for more information:
    I hope this helps.
  2. Like
    abitaquest reacted to Vitalikssssss in JS Date Restrictions Quit Working   
    Hi @edujobs2k18,
    You may try to use the following Javascript solution:  
    <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function(event) { var entered_value = document.getElementById("InsertRecordDate0").value; var entered_date = new Date(entered_value); var permitted_date = new Date(); permitted_date.setDate(permitted_date.getDate()); if(entered_date < permitted_date) { alert("Cannot be a date in the past"); return false; } }); </script> This solution is designed for Submission form with AJAX enabled. Also, field name "Date0" used from your post.
    Hope this helps.
  3. Like
    abitaquest reacted to iren in Prevent Date Selection Less Than 2 Weeks In Future   
    Hello abitaquest,
    On your Submission Form, you can add a Header & Footer element. Then you can select the Footer element, click the "Source" button and enter the following code:
    <SCRIPT LANGUAGE="JavaScript"> function check_date() { var entered_value = document.getElementById("InsertRecordDate").value; var entered_date = new Date(entered_value); var two_week_date = new Date(); two_week_date.setDate(two_week_date.getDate() + 14); if(entered_date < two_week_date)    {       alert("Please select a date after 2 weeks");       return false;    } } document.getElementById("caspioform").onsubmit=check_date; </SCRIPT> Please enter name of your field instead of "FIELDNAME" in the line
    var entered_value = document.getElementById("InsertRecordFIELDNAME").value;   Also you can enter your message instead of "Please select a date after 2 weeks".   I hope, it helps.
  4. Like
    abitaquest reacted to Jan in Automatically Add To An Array   
    Hello abitaquest,
    As far as I know, there is an article how Concatenate/Combine two fields into one field.
    In your case, if I understand correctly, dropdowns will be dynamic fields.
    I have edited the script:

    <SCRIPT LANGUAGE="JavaScript">

    function concatenate()
       var elems = document.getElementsByTagName("*");
       for (var i=0, m=elems.length; i<m; i++)
             if (elems[i].id && elems[i].id.indexOf("InsertRecorddropdown_1") != -1)
                    var position1 = elems[i].value;

       var elems = document.getElementsByTagName("*");
       for (var i=0, m=elems.length; i<m; i++)
             if (elems[i].id && elems[i].id.indexOf("InsertRecorddropdown_2") != -1)
                   var position2 = elems[i].value;

       var allpositions = position1 + ", " + position2;
       document.getElementById("InsertRecorddropdown_values").value = allpositions;


    I hope it helps.
  5. Like
    abitaquest got a reaction from sunilabhat in Link To Attachments Using Parameters   
    Thank you, Emma! This is exactly what I needed.
  6. Like
    abitaquest got a reaction from KennethBrewerr in Keep Attachments From Vanishing After Warnings   
    Hi, all --
    I need a way to keep the user's optional upload attachments from disappearing after a warning. Example: If a user uploads a file but forgets to complete a required field somewhere in the form, he/she will see a warning on Submit. But when the warning appears, the file disappears, and the user must browse again to upload the file. Most of my users don't even notice that their file is no longer attached.
    I believe I've seen a javascript workaround for this in the past, but I have no idea where. Can someone help?
    Thanks in advance.
  • Create New...