Disable Enter key from submitting Wix form

Question:
in a wix form, is it possible to disable the enter key from submitting the form? i.e. Only allow the submit button to submit the form.

Product:
[Which editor or feature is your question most relevant to? e.g. Wix Editor, Wix Studio Editor.]

What are you trying to achieve:
[Explain the details of what you are trying to achieve. The more details you provide, the easier it is to understand what you need.]

What have you already tried:
[Share resources, forum topics, articles, or tutorials you’ve already used to try and answer your question.]

Additional information:
[Include any other pertinent details or information that might be helpful for people to know when trying to answer your question.]

$w.onReady(function () {
    // Select all input fields within the form
    $w('#myForm input').onKeyPress((event) => {
        // Check if the key pressed is "Enter"
        if (event.key === "Enter") {
            // Prevent form submission
            event.preventDefault();
        }
    });
});

I did see that solution from asking ChatGPT. Unfortunately, I’m getting this message from my IDE: Property ‘preventDefault’ does not exist on type ‘KeyboardEvent’.

maybe

event.suppressKey();

may work.

I have not done any testing on this situation in Wix so missed that event.suppressKey(); would not work in the enviroment

Unfortunately, same error message: Property ‘suppressKey’ does not exist on type ‘KeyboardEvent’.