我有一個字段來驗證和淘汰賽處理這個元素的驗證。 接下來,我有一個input-group-addon,當knockout的驗證啓動時越界。我一直在嘗試尋找修復程序,但找不到解決此問題的另一個修復程序。Bootstrap input-group-addon durandal knockout validation
問題:
代碼本身是非常簡單的,說實話:
<div class="form-group" data-bind="validationElement: emailRepeated">
<label for="emailRepeated" data-bind="text: translate('EmailConfirm')">[Confirm your Email Address]</label>
<div class="input-group">
<span class="input-group-addon">@</span>
<input type="email" class="form-control" id="emailRepeated" data-bind="value: emailRepeated" >
</div>
</div>
我的淘汰賽只是有擴展,像這樣:
self.emailRepeated.extend({ required: true, email: true, equal: self.email });
任何人都知道如何保持輸入插件與輸入保持在一起?
編輯:驗證後 結果HTML:
<div class="input-group">
<span class="input-group-addon">@</span>
<input type="email" class="form-control has-error" id="emailRepeated" data-bind="value: emailRepeated" title="This is not a proper email address" data-orig-title="">
<span class="help-block" style="">This is not a proper email address</span>
</div>
工作,是有沒有辦法得到的東西引導工作?我發現,只要它是自定義驗證,你基本上可以使用jquery驗證來定位errormessage框。但是現在無法使用,因爲我使用的是durandal,出於某種原因,他無法在驗證方法中訪問「self」。還有其他建議嗎? – Tikkes 2014-10-18 16:26:58
你可能會創造一個問題的小提琴。淘汰賽本身應該足夠了,因爲我不懷疑杜蘭達在這裏造成任何問題。 – zewa666 2014-10-18 16:44:58
好吧我想我有一個解決方案,更新了答案 – zewa666 2014-10-18 17:27:11