//отмечаем не чётный строки
if ($(".tbl_itemList")){ $(".tbl_itemList .tr1:nth-child(odd)").css('background-color', '#e1dfd9'); }
//типы полей
if (typeof(array_numeric)=="object"){
//только числа
for(t=0;t
Неверное значение (от ' + array_frst[$(this).attr('id')] + ' до ' + array_lst[$(this).attr('id')] + ')
').show(500); $(this).css('background','#fdfdf0'); frm_validate=false; } else if (array_main[t]==$(this).attr('id')) { $(this).css('background','white'); } } } } ); if (frm_validate) return true; else { //плавный скроллинг $("html:not(:animated)"+( ! $.browser.opera ? ",body:not(:animated)" : "")).animate({scrollTop: $('#tbl_pitems_js').position().top}); return false; } } //INPUT: потеря фокуса $("#tbl_pitems_js").find("input").blur( function(){ $(this).css('border', '1px solid #BBBBBB'); $(this).css('padding', '3px'); //валидация for(t=0;tНеверное значение (от ' + array_frst[$(this).attr('id')] + ' до ' + array_lst[$(this).attr('id')] + ')
').show(500); $(this).css('background','#fdfdf0'); frm_validate=false; } else if (array_main[t]==$(this).attr('id')) { $( "#td_" + $(this).attr('id') + "_js" ).html(''); $(this).css('background','white'); } } } ); //INPUT: фокус $("#tbl_pitems_js").find("input").focus( function(){ $(this).css('border', '2px solid #2490C2'); $(this).css('padding', '2px'); } ); //INPUT: ушёл $("#tbl_pitems_js").find("input").mouseout( function(){ if (document.activeElement!=this){ //если эл не в фокусе $(this).css('border', '1px solid #BBBBBB'); $(this).css('padding', '3px'); } } ); //INPUT: курсор над элементом $("#tbl_pitems_js").find("input").mouseover( function(){ if (document.activeElement!=this){ //если эл не в фокусе $(this).css('border', '2px solid #BBBBBB'); $(this).css('padding', '2px'); } } ); //SELECT: потяре фокуса $("#tbl_pitems_js").find("select").blur( function(){ $(this).css('border', '1px solid #BBBBBB'); $(this).css('padding', '3px'); //валидация селекта if ($(this).attr('value')=="NOT"){ $( "#td_" + $(this).attr('id') + "_js" ).hide().html('
Нужно выбрать значение из списка
').show(500); $(this).css('background','#fdfdf0'); }else{ $( "#td_" + $(this).attr('id') + "_js" ).html(''); $(this).css('background','white'); } } ); //SELECT: ушёл $("#tbl_pitems_js").find("select").mouseout( function(){ if (document.activeElement!=this){ //если эл не в фокусе $(this).css('border', '1px solid #BBBBBB'); $(this).css('padding', '3px'); } } ); //SELECT: фокус $("#tbl_pitems_js").find("select").focus( function(){ $(this).css('border', '2px solid #2490C2'); $(this).css('padding', '2px'); } ); //SELECT: курсор над элементом $("#tbl_pitems_js").find("select").mouseover( function(){ if (document.activeElement!=this){ //если эл не в фокусе $(this).css('border', '2px solid #BBBBBB'); $(this).css('padding', '2px'); } } ); //TEXTAREA: потяре фокуса $("#tbl_pitems_js").find("textarea").blur( function(){ $(this).css('border', '1px solid #BBBBBB'); $(this).css('padding', '3px'); } ); //TEXTAREA: ушёл $("#tbl_pitems_js").find("textarea").mouseout( function(){ if (document.activeElement!=this){ //если эл не в фокусе $(this).css('border', '1px solid #BBBBBB'); $(this).css('padding', '3px'); } } ); //TEXTAREA: фокус $("#tbl_pitems_js").find("textarea").focus( function(){ $(this).css('border', '2px solid #2490C2'); $(this).css('padding', '2px'); } ); //TEXTAREA: курсор над элементом $("#tbl_pitems_js").find("textarea").mouseover( function(){ if (document.activeElement!=this){ //если эл не в фокусе $(this).css('border', '2px solid #BBBBBB'); $(this).css('padding', '2px'); } } ); //если изменена категория подгружаем параметры (Ajax) $("#i_type_js").change(function(){ function onAjaxSuccess(data){ if (data) { $("#tbl_param_js").remove(); $("#_param_container_js").html(data); } } $.post( '/include/ajax/ajax_people_frm_item_type.php', { 'tp_id' : $(this).attr("value"), 'i_id' : i_id }, onAjaxSuccess ); }); //выполнить после нолной загрузки страницы $(document).ready( function() { var ind_edit=0; //вывод ред. индификатора(mail) по клику if (document.getElementById("_edit_ind_js")!=null){ $('#_edit_ind_js').bind('click', function(){ $("#div_advr_form").overlay({ top: 185, absolute: true, expose: { color: '#fff', loadSpeed: 200, opacity: 0.5 }, closeOnClick: false, api: true }).load(); $("#i_advrt_ind_js ").focus(); }); ind_edit=1; } //Ввод индификатора if (document.getElementById("h2_indificator")==null){ //Показать диалог ввода индификатора - мейла $("#div_advr_form").overlay({ top: 185, absolute: true, expose: { color: '#fff', loadSpeed: 200, opacity: 0.5 }, closeOnClick: false, closeOnEsc: false, api: true }).load(); } //ставим фокус в поле ввода $("#i_advrt_ind_js ").focus(); //обрабатываем "enter" в поле ввода $('#i_advrt_ind_js').keydown(function(event) { if (event.keyCode == '13' && $(this).attr('value')!='') { $('#ib_advrt_ind_js').click(); } }); //ввод индификатора (проверка) $('#ib_advrt_ind_js').click(function(){ if ($('#i_advrt_ind_js').attr('value')!='') { $.post( '/ajax/', { advr_ind: $("#i_advrt_ind_js").attr("value"), _type: 'set_advr_ind'}, function (data){ if (data=='1'){ //ИНДИФИКАТОР принят успешно $("#i_advrt_ind_js").attr('class', 'button'); $("#div_advr_form p.text").html(''); if (ind_edit==1) { //если инд. был изменён редактированием - перезагружаем страницу $("#div_advr_form p.text").html('Подождите...'); $(location).attr('href',''); }else{ $("#div_advr_form").overlay().close(); } if (document.getElementById("h2_indificator")==null) $("#p_anchor").append('