Using the jQuery Validate plugin, how can I wrap the error message string in a span

前端 未结 3 1364
再見小時候
再見小時候 2021-01-26 13:15

Does anyone know how to wrap the inner error string in a span? I\'m using the jQuery Validate plugin for my form and getting the default error message displaying in label tags,

3条回答
  •  长情又很酷
    2021-01-26 13:31

    you can define your error message like:

    var validator = form.validate({
      rules: {
        username: {
          required: true,
          minlength: 3
        }
      },
      messages: {
        username: {
          required: ' required ',
          minlength: ''
        }
      },
    

提交回复
热议问题