Making fields active for entry on load

  • Profile Image
    scooterjoesdt
    Asked on March 07, 2017 at 12:24 AM

    Is there a method to force a field to be active for data entry ... specifically, when I load a form on a tablet such as an iPad, it would be very useful for the field to be active and ready for data entry vs. having to touch the field first?  So essentially an ONLOAD function perhaps?

  • Profile Image
    Chriistian
    Answered on March 07, 2017 at 04:06 AM

    Unfortunately, this isn't possible with JotForm builder. This requires injecting Javascript code which is not allowed by our system. If you want to focus fields when form loads, you need to get the full source code of your form and inject the Javascript code.

    Here's a sample code for this, where the input_field is the field ID. Guide: How to find field IDs and names.

    <script>

    document.observe("dom:loaded", function() {

      $('input_field').focus();

    });

    </script>

    However, in this way you will not be able to put the code back to our server, instead, you will have to host the form somewhere else.

    Let us know if you need further assistance.
    Regards