hx-validate

hx-validate 属性将导致元素在提交请求之前通过 HTML5 验证 API 验证自身。

¥The hx-validate attribute will cause an element to validate itself by way of the HTML5 Validation API before it submits a request.

只有 <form> 元素默认验证数据,其他元素不验证。将 hx-validate="true" 添加到 <input><textarea><select> 可在发送请求之前进行验证。

¥Only <form> elements validate data by default, but other elements do not. Adding hx-validate="true" to <input>, <textarea> or <select> enables validation before sending requests.

注释

¥Notes