Don't refresh page when enter key is pressed

后端 未结 4 1611
失恋的感觉
失恋的感觉 2021-02-09 17:03

I\'m having some problems with the enter key triggering a refresh of the page whenever there is input in a form.

The following code does not refresh the page if enter is

4条回答
  •  Happy的楠姐
    2021-02-09 17:22

    you can either add following script at the end of body

    
    

    or you can just put your form tag like this

    either way you will then have to write an onClick="SOMEFUNCTION()" to the input

    also there is an error with an extra /button tag...remove that and instead use

    
    

    note the ending slash

提交回复
热议问题