2016-01-07 20 views
0

有沒有可能改變劍道驗證錯誤訊息的外觀?我不想爲顯示錯誤消息:劍道用戶自訂錯誤訊息

default error message in kendo-ui

我想顯示錯誤消息的提示。驚歎號應該是紅色,懸停後應該顯示錯誤信息。但是正如你所看到的那樣,顯示了來自kendo的默認消息格式。

enter image description here

的glyphicon是從引導。解決方案可以使用Kendo或angularJS編寫。 感謝您的幫助!

+0

,就着手進行您共享的代碼片段! –

+0

是的。用自己的方式覆蓋Kendo的風格。 – Brett

回答

0

Kendo UI驗證器可以爲自定義驗證指標設置errorTemplate。

$("#myform").kendoValidator({ 
    errorTemplate: "<span class='custom-error'>#=message#</span>" 
}); 

你的HTML

<form id="myform"> 
    <input name="username" required /> <br /> 
    <button>Validate</button> 
</form> 

在樣式定義,你可以定義自己的風格

.custom-error { 
    color: red; 
}