я пытался построить XPage с Bootstrap Validator (http://bootstrapvalidator.com/examples/mask/) для проверки в IP-АдресXPages: Bootstrap валидатора
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" id="testid">
<xp:this.resources>
<xp:styleSheet href="/bootstrap.css"></xp:styleSheet>
<xp:styleSheet href="/bootstrapValidator.min.css"></xp:styleSheet>
<xp:script src="/jquery-1.11.1.js" clientSide="true"></xp:script>
<xp:script src="/bootstrap.min.js" clientSide="true"></xp:script>
<xp:script src="/bootstrapValidator.js" clientSide="true"></xp:script>
<xp:script src="/jquery.mask.min.js" clientSide="true"></xp:script>
</xp:this.resources>
<xp:form id="maskForm">
<div class="col-lg-5">
<xp:inputText id="ipAddress" title="ipAddress">
</xp:inputText>
</div>
</xp:form>
<xp:scriptBlock>
<xp:this.value><![CDATA[
var test = '#{javascript:getClientId("maskForm")}';
XSP.addOnLoad(function() {
$("#"+test)
.bootstrapValidator({
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
ipAddress: {
validators: {
ip: {
message: 'The IP address is not valid'
}
}
}
}
})
.find('[name="ipAddress"]').mask('099.099.099.099');
});
]]></xp:this.value>
</xp:scriptBlock>
</xp:view>
Можете ли вы сказать мне where's моей вине /, как это работает с XPages? Это didn't работать с моим inputText поле
Спасибо за вашу помощь
THX Брайан и Пер для вашей справки. Теперь валидация работает, и я не могу напечатать текст или что-то еще. Но я не получаю сообщение об ошибке «IP-адрес недопустим», и поле редактирования не меняет цвет на красный. Хм ... есть еще что-то неправильное – Stefan1988