所以我有一个简单的表格:
<form class="cmxform" id="commentForm" method="get" action="" style="padding:7px">
<fieldset>
<legend>Please provide your name, email address (won't be published) and a comment</legend>
<p>
<label for="cccel">Cel</label><br />
<input class="form-control" id="ccel" name="cel" minlength="10" maxlength="10" type="text" type="number" required>
</p>
<p>
<label for="ccelconf">Confirma tu Celular</label><br />
<input class="form-control" id="ccelconf" name="cel" minlength="10" maxlength="10" type="text" name="celconf" type="number" required>
</p>
<p>
<label for="cocr">OCR</label><br />
<input class="form-control" id="cocr" minlength="9" maxlength="13" type="text" name="ocr" type="number" required>
</p>
<p>
<label for="cocrconf">Confirma tu OCR </label><br />
<input class="form-control" id="cocrconf" minlength="9" maxlength="13" name="ocrconf" type="number" required>
</p>
<p>
<input class="submit" type="submit" value="Submit">
</p>
</fieldset>
</form>
我的问题是,你能改变所需的最小长度通知语言吗? 或者至少可以编辑它们吗?
如果可能的话会如何。
答案 0 :(得分:-1)
好吧,它正在编辑jquery.validate.js脚本,抱歉。
好的,转到该文件,然后在消息部分改变你想要的方式:
messages: {
required: "Este Campo es requerido",
remote: "Please fix this field.",
email: "Please enter a valid email address.",
url: "Please enter a valid URL.",
date: "Please enter a valid date.",
dateISO: "Please enter a valid date ( ISO ).",
number: "Please enter a valid number.",
digits: "Please enter only digits.",
creditcard: "Please enter a valid credit card number.",
equalTo: "Please enter the same value again.",
maxlength: $.validator.format( "Por favor no ingreses mas de {0} caracteres" ),
minlength: $.validator.format( "Por favor ingresa al menos {0} caracteres" ),
rangelength: $.validator.format( "Por favor ingresa un valor de entre {0} y {1} caracteres" ),
range: $.validator.format( "Please enter a value between {0} and {1}." ),
max: $.validator.format( "Please enter a value less than or equal to {0}." ),
min: $.validator.format( "Please enter a value greater than or equal to {0}." )
},