• Resolved luciche

    (@luciche)


    Hello, on my website [ short link deleted, do not use those here again ], mobile version, if I tap on the Go button (https://ibb.co/DpMGFRp) it reloads the page. Can you please tell how to stop this ?
    Thank you

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @luciche

    “Go” is the equivalent to “enter” on desktop, and the HTML standard submits the form with the enter is pressed. If you want to disable this behavior, please, insert an “HTML Content” in your form with the following piece of code as its content:

    <script>
    fbuilderjQuery(document).one('showHideDepEvent', function(){
        var $ = fbuilderjQuery;
        $('#fbuilder :input').keyup(function(evt){
            if (evt.keyCode === 13) {
                evt.preventDefault();
                evt.stopPropagation();
                return false;
            }
        });
    });
    </script>

    Best regards.

    Thread Starter luciche

    (@luciche)

    I’ve added an HTML field in the form with the code above, but there is no difference. Can I just disable the submit option for this form?
    I only use it to calculate and not to submit.
    Thank you

    Plugin Author codepeople

    (@codepeople)

    Hello @luciche

    My apologies, please, use the keypress event instead:

    <script>
    fbuilderjQuery(document).one('showHideDepEvent', function(){
        var $ = fbuilderjQuery;
        $('#fbuilder :input').keypress(function(evt){
            if (evt.keyCode === 13) {
                evt.preventDefault();
                evt.stopPropagation();
                return false;
            }
        });
    });
    </script>

    Best regards.

    Thread Starter luciche

    (@luciche)

    That worked, but I was wondering if it’s possible to close/collapse the numeric keyboard after taping on GO, so the users can see the rest of the form. Most of them don’t know how to close/collapse the numeric keyboard, and it covers half the screen.
    Thank you

    Plugin Author codepeople

    (@codepeople)

    Hello @luciche

    You can try with the following modification:

    <script>
    fbuilderjQuery(document).one('showHideDepEvent', function(){
        var $ = fbuilderjQuery;
        $('#fbuilder :input').keypress(function(evt){
            if (evt.keyCode === 13) {
                evt.preventDefault();
                evt.stopPropagation();
                $(this).blur();
                return false;
            }
        });
    });
    </script>

    Best regards.

    Thread Starter luciche

    (@luciche)

    Does this script work in all forms? I’ve added an HTML field in 2 forms, and in one form works but not in the other. For example, in this one https://notariate.ro/calculator-taxe-notariale/?ipoteca
    Thank you

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @luciche Do not use short links in these forums, that has been abused in the past and is expanded when found. I have expanded yours.

    Plugin Author codepeople

    (@codepeople)

    Hello @luciche,

    I guess there is another script on your page that takes the control of the keypress event. Please, edit the code as follows:

    <script>
    fbuilderjQuery(document).one('showHideDepEvent', function(){
        var $ = jQuery;
        $('#fbuilder :input').on('keypress keydown keyup', function(evt){
            if (evt.keyCode === 13) {
                evt.preventDefault();
                evt.stopPropagation();
                $(this).blur();
                return false;
            }
        });
    });
    </script>

    Best regards.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Go button on mobile’ is closed to new replies.