0
我有一個表格:顯示自定義屬性引導提示
<form method="post" id="update_user_info" action="/Cabinet/Edit">
<div class="modal-header">
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
<h3 id="myModalLabel">Modal Header</h3>
</div>
<div class="modal-body">
<div class="span4 clear_mp">
<div class="span2 pull-left clear_mp">
<label for="FirstName">Name</label>
<input type="text" value="John" name="FirstName" id="FirstName" />
</div>
<div class="span1 pull-right clear_mp">
<label for="CarMark">Car</label>
<input type="text" value="SUBARU LEGACY" name="CarMark" id="CarMark" />
</div>
<div class="span1 pull-right clear_mp">
<label for="Email">Email</label>
<input type="text" value="[email protected]" name="Email" id="Email" data-val-email="The email is wrong" data-val="true" class="input-validation-error" />
</div>
<div class="span2 pull-left clear_mp">
<label for="PhoneNumber">Phone number </label>
<input type="text" value="" name="PhoneNumber" id="PhoneNumber" data-val-regex-pattern="(\+)?77[0-9]{9}" data-val-regex="The phone number is wrong" data-val="true" />
<span data-valmsg-replace="true" data-valmsg-for="PhoneNumber" class="field-validation-valid"></span>
</div>
</div>
</div>
<div class="modal-footer">
<input type="submit" value="Save" id="update_user_info" class="btn btn-large btn-primary" />
</div>
</form>
我要做到以下幾點:
1.找到input
它們具有類input-validation-error
(在這裏,我沒有問題)
2.獲取data-val-*
(*表示電子郵件或正則表達式或其他)屬性的值,並在輸入中顯示具有此值的引導工具提示?
我該怎麼做?