[英]Override font size on pre made validation script
I am trying to add validation to my text boxes and have been able to do so.我正在尝试向我的文本框添加验证并且已经能够这样做。 I am running into a problem with the font size when you type the wrong thing into the text box and don't know how to fix it.当您在文本框中键入错误的内容并且不知道如何修复时,我遇到了字体大小问题。 The validation script I am using is:我使用的验证脚本是:
https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/jquery.validate.js https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/jquery.validate.js
I have included photos of what I am talking about.我已经包含了我正在谈论的照片。
I am trying to figure out how to make that font smaller.我想弄清楚如何使该字体变小。 I do not believe there is a css with this js file.我不相信这个 js 文件有一个 css。 Even if there is there has to be a place to override it.即使有,也必须有一个地方可以覆盖它。 I will also include my script tag.我还将包括我的脚本标签。
$(document).ready(function() {
$("#form1").validate({
rules: {
<%=tbSearchTransactionID.UniqueID %>: {
digits: true
},
<%=tbSearchOrderNo.UniqueID %>: {
digits: true
}
}, messages: {
%=tbSearchTransactionID.UniqueID %>: {
digits: "Enter a number"
}
}
});
});
Also, this is where the text boxes sit:此外,这是文本框所在的位置:
<h3>ShopFloor Transactions</h3>
<div class="form-row">
<div class="col">
<asp:TextBox ID="tbSearchTransactionID" runat="server" CssClass="form-control" placeholder="Transaction ID"></asp:TextBox>
</div>
<div class="col">
<asp:TextBox runat="server" ID="tbSearchOrderNo" CssClass="form-control" placeholder="Order Number"></asp:TextBox>
</div>
<div class="col">
<asp:TextBox runat="server" ID="tbSearchWorkCenter" CssClass="form-control" placeholder="Work Center"></asp:TextBox>
</div>
</div>
So I bring in this big validate file.所以我引入了这个大的验证文件。 Have a small script tag running.运行一个小脚本标签。 Then have it linked to the text box names but I do not know where I can edit this font.然后将它链接到文本框名称,但我不知道在哪里可以编辑此字体。
<script type="text/javascript">
$(document).ready(function () {
$("#form1").validate({
rules: {
<%=tbSearchTransactionID.UniqueID %>: {
digits: true
},
<%=tbSearchOrderNo.UniqueID %>: {
digits: true
}
}, messages: {
<%=tbSearchTransactionID.UniqueID %>: {
digits: "<span style='font-size: 20px;'>Enter a number</span>"
},
<%=tbSearchOrderNo.UniqueID %>: {
digits: "<span style='font-size: 20px;'>Enter a number</span>"
}
}
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.