1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
$(function() {
var updateNbCaractereSommaire = function(){
$('#lblModifierSomaireCaracteres').text(<%= Me.ViewData("nbCaractereMaxSommaire") %> - $('#txtSommaire').val().length + " caractère(s) restant(s)");
if( $('#txtSommaire').val().length <= <%= Me.ViewData("nbCaractereMaxSommaire") %>)
{
$('#lblModifierSomaireCaracteres').css("color","green");
}
else
{
$('#lblModifierSomaireCaracteres').css("color","red");
}
}
$("input[type=submit]").onclick(function(){
if(verification des champs ){
updateNbCaractereSommaire();
if(autre condition)
return true;
}
}
}); |