J
J
Johniq2017-10-10 00:23:33
JavaScript
Johniq, 2017-10-10 00:23:33

How to prevent form submission when location is selected in react-google-places-suggest?

There is such a select for selecting locations ITmB_3NXRTC55eXg7_UcIQ.png, it is in the form, when I select a location by pressing enter, the form is sent, preventDefault does not help, playing with keyCode too, the form still flies to the server, how to prevent this in a normal way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2017-10-10
@maxfarseer

Maybe the form has an onSubmit event. Remove it and make the form submit only on onClick on the submit button.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question