Element: [Bug Report] Prevent submit when press enter using input form. bug with input ...

Created on 15 Aug 2017  ·  5Comments  ·  Source: ElemeFE/element

Element UI version

1.4.2

OS/Browsers version

chrome

Vue version

2.4.2

Reproduction Link

https://jsfiddle.net/hoanghiep/orgswrtf/2/

Steps to reproduce

  1. You just run it.
  2. Add a new tag and try several times

What is Expected?

how to fix error auto submit reload page. {"error": "Please use POST request"}

What is actually happening?

I can not combine el-form-items with other el-input.
When you enter enter it automatically send form when not enough information

Most helpful comment

<el-form @submit.prevent.native="checkEnter">

All 5 comments

thanks your @Leopoldthecoder

<el-form @submit.prevent.native="checkEnter">

If you want to call specific functions rather than ignore the input completely, use

<el-input @keyup.enter.native="someAction()"></el-input>

You can use @keypress.enter.native="submitForm('resetPasswordForm')" , Ref: https://polinwei.com/element-ui-prevent-form-submit/

Was this page helpful?
0 / 5 - 0 ratings