Jump to content

perland

Members
  • Posts

    10
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by perland

  1. If you just want to print the <form id="caspioform" ... a simple way will be to create a footer in your report form and copy the code below.

     

     

    <input type="button" onclick="printDiv('caspioform')" value="Print caspioform" />

     <script>
    function printDiv(divName) {
         var printContents = document.getElementById(divName).innerHTML;
         var originalContents = document.body.innerHTML;
         document.body.innerHTML = printContents;
         window.print();
         document.body.innerHTML = originalContents;
    }

    </script>

    VK.

  2. Hello,

     

    I have a user registration from with an email and email confirmation field tied to Table_2. I would like the email address that is entered to be verified against an email filed in Table_1, and give a “does not exist†prompt if the email address is not in Table_1. Basically a user has to have an email in Table_1 to be able to register for Table_2.

     

    Any help or suggestion will be very much appreciated.

     

    Thank You,

     

    VK

  3. MayMusic,

     

    Thank you for your suggestion all worked fine. For a single record update form with a textbox field called Phone_Home, I used the code below placed in the footer:

     

    <SCRIPT LANGUAGE="JavaScript">

    function tel()
    {

     // Read the content of the textbox
    var message = document.getElementById("EditRecordPhone_Home").value;
     

    //Skip function if textbox is empty, else you will see () -

    if (message != "") {
     

    // Strip off all the spaces
    document.getElementById("EditRecordPhone_Home").value = (message.replace(/[^\d]/g, ''));

    var message1 = document.getElementById("EditRecordPhone_Home").value;
    document.getElementById("EditRecordPhone_Home").value = ("(" + message1.substring(0,3) + ") " + message1.substring(3,6) + "-" + message1.substring(6,10));
    }
    }

     

    // Call function when value in the textbox changes
    document.getElementById('EditRecordPhone_Home').onchange=tel;

    </SCRIPT>

     

     

    I have three other fields called Phone_Work, Phone_Cell and Phone_Fax. Would you happen to know a single code that can be called for all four fileds. The other option will be to copy the above code 4 times.

     

    Thank You again.

  4. Hello,

     

    How can I make an onchnage event trigger a function that converts a number in 1234567890 to (123) 456-7890 format.

     

    The function works fine, but the onchange statement does not trigger the function. This is on a single record update form.

     

    Thank You.

     

    <SCRIPT LANGUAGE="JavaScript">

    function phoneFormat(phone) {
    phone = phone.replace(/[^0-9]/g, '');
    phone = phone.replace(/(\d{3})(\d{3})(\d{4})/, "($1) $2-$3");
    return phone;
    }

    document.getElementById('EditRecordPhone_Home').onchange=phoneFormat(document.getElementById('EditRecordPhone_Home').value);
    </SCRIPT>
     

  5. Hello,

    I have a search and report DataPage that I would like to show the difference between two dates in days. The start day will be new Date(), and the end date a time field in a table. Below is an outline of the code. Is there an easy way to do this?

    Thank You.

    var StartDate = new Date();

    var EndDate = document.getElementById("InsertRecordpatient_status_change_timestamp").value;

    Var NumberDays = StartDate-EndDate

    document.write(NumberDays);

  6. Hello,

    I have a details page with an update button where I would like to be able to update the value of a Text Field with the current date whenever a user changes the value of an option in a Dropdown menu and clicks update.

    The code below below is not working. Any help will be very much appreciated.

    Thank You.

    function getT()

    {

    document.getElementById("EditRecordpatient_status").onchange == document.getElementById("EditRecordpatient_status_change_timestamp").value = '[@cb:Timestamp]';

    }

    document.getElementById("Mod0EditRecord").onclick=getT;

×
×
  • Create New...