Copy link to clipboard
Copied
Hey everyone,
Hope all is well.
I am trying to prevent the user from hitting the enter key on a multi-line text field. It is important that the field has 512 characters and I have already limited it upon formatting.
However, whenever the individual uses Enter to write in another line, it appears that something happens and when I import the data there seems to be more characters (?) and I get an error. If the same text is entered but no enter key has been pushed, I can successfully import.
Is there any way I can prevent the user from hitting key 13?
I looked around and it seems to be something related to preventDefault, so would appreciate if someone could point me in the right direction or share any piece of code that could be used.
Many thanks,
Yeah, it's possible. Use this code as the field's custom Keystroke field (select Custom under Format to gain access to it):
event.rc = /[\r\n]/.test(event.change)==false;
Copy link to clipboard
Copied
Yeah, it's possible. Use this code as the field's custom Keystroke field (select Custom under Format to gain access to it):
event.rc = /[\r\n]/.test(event.change)==false;
Copy link to clipboard
Copied
Works like a charm!
Thank you so much for your help, it is much appreciated!
Best Regards,