Issue with form submission on click of "Enter" through keyboard


#1

Hi Team,

I have some specific validation before posting data to our database. I am using unbind/bind “click tap touchstart” to call a function for specific validation. The problem is, when user clicks “Enter” through keyboard, it doesn’t call the function. Can you please help me here to handle Enter keyword.

Thanks !!
Brijesh Singh


#2

Hey @bksingh

Are you using this script for your custom validation?


#3

Hi @Kyle.C,

Yes, i am using the same but somehow, even if after e.preventDefault(), “Enter” key is submitting the form.

Please let me know if i can provide more information.

Thanks,
Brijesh Singh


#4

Hmmm okay,

Could you provide a URL to the page please?


#5

Hi @Kyle.C,

Please find the url:

https://landing.technologyevaluation.com/test-kentico-10/

Thanks,
Brijesh Singh


#6

Hi @Kyle.C,

Wondering if you had some moment to check my link.

Thanks,
Brijesh Singh


#7

Sorry it took me a few days to get back to this,

There are a couple errors I see in the console on your page, I recommend correcting those if you can.

But specifically regarding the script for custom validation, could you make sure it is placed in the “Before Body End Tag” position? I’m wondering if you currently have the script placed in the “After Body Tag” position, and we don’t want it in there :slight_smile:

image


#8

Hi @Kyle.C,

Thanks for your reply. I placed it before body end tag but still it is not working.

The console errors are trying to get some information about IP but it is not related to this issue.

Thanks,
Brijesh Singh


#9

Hi @Kyle.C,

Any help would be highly appreciated.

Thanks,
Brijesh Singh