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.
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
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.
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
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.
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.
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.