Solution to Automatic Submission in the Layui Form

The button in the Layui form will be submitted automatically, this is a very troublesome thing.

For several days, the form button has been used in the project, carefully studied, found the solution:

1. If you don’t need to put it in the form Buttons, it is best not to place it in the form, no buttons in the form of the Layui will not be submitted;

2, the button placed in the form can add Return FALSE through the callback function in JS stop. The parameters in the FILTER refer to the value in the Lay-Filter property in the button, which can be casually set.

For example:

Form.on (‘Submit (Filter), Function (DATA) {… returnaf false;})
  However, there is a problem that it is easy to ignore: If the Lay-Submit property does not add a lay-subs attribute in the button, the form submission of the Layui's form is not available. Then Return False invalidate the submitted stop.  3, there is another method, which is to replace Button using the buttons made by the A tag. 
“ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ “ `
4, thank you for your commentary Finger:

Button’s TYPE is set to Button will not be submitted automatically. The default is Submit, which will be submitted automatically.

The above solution about the button in the Layui form is the full content of Xiaobian sharing to everyone, I hope to give you a reference, I hope everyone will support Tumi Cloud.

© Copyright Notice
Just support it if you like
comment Grab the couch

Please log in to comment