how to set editor-field required attribute and html5 support(types such as email,tel,num)

how to set editor-field required attribute and html5 support(types such as email,tel,num)

zhangxlzhangxl Posts: 3Questions: 1Answers: 0
edited December 2018 in Editor

some one give me examples,
appreciate!

Answers

  • allanallan Posts: 61,669Questions: 1Answers: 10,096 Site admin
    edited May 2019

    You can use the attr option of the text field type (and most others) to apply an attribute to a field.

    {
      label: "My required input:",
      attr: {
        required: true
      }
    }
    

    That can also be used to set the input type:

    {
      label: "My required input:",
      attr: {
        type: 'email',
        required: true
      }
    }
    

    Allan

This discussion has been closed.