36 lines
1.4 KiB
JavaScript
36 lines
1.4 KiB
JavaScript
|
$(document).ready(function() {
|
||
|
if (!id_language)
|
||
|
var id_language = Number(1);
|
||
|
var limitChar = 160;
|
||
|
$('div.input_info .textarea-autosize').on('keydown',function(){
|
||
|
if($(this).val().length > limitChar ){
|
||
|
$(this).css('border-color','#E27C79');
|
||
|
$('div.input_info .textarea-autosize+p.help-block').css('color','#E27C79');
|
||
|
/*$(this).val($(this).val().substring(0, limitChar));*/
|
||
|
}else{
|
||
|
$(this).css('border-color','#66AFE9');
|
||
|
$('div.input_info .textarea-autosize+p.help-block').css('color','#959595');
|
||
|
}
|
||
|
});
|
||
|
$('div.input_info .textarea-autosize').on('keyup',function(){
|
||
|
if($(this).val().length > limitChar ){
|
||
|
$(this).css('border-color','#E27C79');
|
||
|
$('div.input_info .textarea-autosize+p.help-block').css('color','#E27C79');
|
||
|
/*$(this).val($(this).val().substring(0, limitChar));*/
|
||
|
}else{
|
||
|
$(this).css('border-color','#66AFE9');
|
||
|
$('div.input_info .textarea-autosize+p.help-block').css('color','#959595');
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$('div.input_info .textarea-autosize').on('blur',function(){
|
||
|
if($(this).val().length > limitChar ){
|
||
|
$(this).css('border-color','#E27C79');
|
||
|
$('div.input_info .textarea-autosize+p.help-block').css('color','#E27C79');
|
||
|
/*$(this).val($(this).val().substring(0, limitChar));*/
|
||
|
}else{
|
||
|
$(this).css('border-color','#CCC');
|
||
|
$('div.input_info .textarea-autosize+p.help-block').css('color','#959595');
|
||
|
}
|
||
|
});
|
||
|
});
|