The out-of-focus event of calling input in the submit function of Mini Program's form will report an error. Ask for guidance.

WeChat Mini Programs does form form submission. I call each input-bound out-of-focus event in the submit function of the form component, and verify each input data before submitting the form, but find that calling the out-of-focus event directly will report an error. The specific code is as follows:

<form bindsubmit="submit">
<input placeholder="" bindblur="checkName"/>
<input placeholder="" bindblur="checkPassword"/>
<button form-type="submit"></button>
</form>

Page({
  data: {
    name: "",
    password: ""
  },
  checkName:function (e) {
    //
    console.log(e.detail.value);
    if(){
    return true;
    }
    return false;
  },
  checkPassword:function(e) {
    //
    console.log(e.detail.value);
    if(){
    return true;
    }
    return false;
  },
  submit:function (e) {
    if (!this.checkName()) return
    if (!this.checkPassword()) return
  }
})

error: Cannot read property "detail" of undefined;at pages/index/index page checkName function
TypeError: Cannot read property" detail" of undefined

if you do not call those out-of-focus functions in submit, the normal input out-of-focus can print e.detail.value, but why do you report an error when adjusted


if you call the function directly, if the this cannot be passed, you can't get the user name and password.
the correct way is to bind the value of the component to the name and password in data
check the name and password, in the data so that no matter where the function is called, it can run normally

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ab9c-2c23e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ab9c-2c23e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?