HTML Code:       --   Thanks,   Prashant    ", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A937vSAB", "datePublished": "2018-06-24T04:24:22.000Z", "author": { "@type": "Person", "name": "Prashant Pandey", "url": "https://trailblazers.salesforce.com/profileView?u=0053000000B2K7PAAV", "affiliation": { "@type": "Organization", "name": "TSPi" } } } ] } } Skip to main content
Lhotse Springer (Salesforce) 님이 #Data Management에 질문했습니다
Hello Everyone:

 

We are receiving many incomplete forms because some of our users press ENTER to jump from field to field instead of pressing TAB. When they press ENTER they submit the form prematurely. Is there a way to change the ENTER function? 

 

Thanks in advance!
답변 2개
  1. 2018년 6월 24일 오전 4:24
    Hi  Lhoste,

     

    You can make all the input field required so that user must all the field.like this..

     

     

    <label for="company">Company</label><input id="company" maxlength="40" name="company" size="20" type="text" required/><br>

     

    In case you don't want to force the users to enter all the filed then you may add /Modify this code in the existing form

     

    Javascript code:

    <SCRIPT LANGUAGE="javascript">

    function testForEnter() {

    if (event.keyCode == 13)

    {

    event.cancelBubble = true;

    event.returnValue = false;

    }

    }

    </SCRIPT>

     

    HTML Code:

     

     

    <input type="submit" name="submit" onkeydown="testForEnter();">

     

    --

     

    Thanks,

     

    Prashant