Disable "Enter to submit Form"? (i.e., how to allow Bootstrap's "tagsinput")

Confluence User - 10 Apr, 2022

Hello Everyone!

I'm still learning Joget in my part time. I know we have bootstrap under the hood, and REALLY like tags input; see here: https://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/

I am trying to use Custom HTML in my form:

<input type="text" id="tags" name="tags"  value="" placeholder="single, word, tags" data-role="tagsinput" />  


However, the default behavior of the Page/Submit button is to submit the form IF enter is pressed. Can we disable this via Custom HTML or in the properties?

Thanks!
Fro

Also looked at:
1. https://dev.joget.org/community/display/FORUM/how+to+disable+the+submit+button+in+form (i.e., close. but N/A)
2. https://dev.joget.org/community/questions/25593209/can-i-create-a-submit-button-on-a-form (From Anders we know Submit is AUTO created)
3. https://dev.joget.org/community/questions/25134119/to-disable-the-form-submit-if-the-condition-is-null-in-the-list (NULL is "ok", so this is N/A – it's not an error; and I really dislike having an "check ok to continue" portion of the form)

forms;customcode;javascript;bootstrap

2


13 Apr, 2022
confluenceUser
confluenceUser

Hi, form submission using ENTER is a default browser behavior. You could try to use custom JavaScript to disable that behavior like in https://stackoverflow.com/questions/5629805/disabling-enter-key-for-form.

15 Apr, 2022
confluenceUser
confluenceUser

Hi Anders!

Thanks for the response. I did look at very similar posts (even ones that locked it to bootstrap – https://stackoverflow.com/questions/59503468/prevent-bootstrap-form-to-submit-with-enter). However, the "tags" addition uses enter to "store" the tag.

Alternatively: I was looking at enabling the save key to be space vs. enter (which then your reference would work).

I'll keep poking at this.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print