0
我試圖在div內顯示錯誤標籤,但它不起作用。jquery驗證:在自定義div內顯示錯誤標籤
<div class="panel-body">
<div class="well-custom datecontrol-fixed datecontrol-fixed-xs">
<div class="input-group">
<input type="text" class="form-control input-sm" id="TextBoxProdMoveDate" name="TextBoxProdMoveDate"/>
<label class="input-group-addon btn" for="TextBoxProdMoveDate">
<span class="glyphicon glyphicon-calendar"></span>
</label>
</div>
<div id="DivProdMoveDateErrorContainer"></div>
</div>
</div>
而且,設置這樣的規則,
required: true,
messages: {required: "Production move date is required."},
errorLabelContainer: '#DivProdMoveDateErrorContainer',
,但是,它不工作。
我期待的是,在DivProdMoveDateErrorContainer中顯示錯誤標籤。
任何建議將不勝感激。
我得到了你的觀點。從我+1爲可能的解決方案。但是,我不想爲所有控件手動添加這些錯誤標籤。我正在尋找的是,jQuery驗證應該將該錯誤標籤放在特定的div容器中。 –
檢查我更新的答案 –