буду честен мне нужно в этом коде чтобы кнопка #trAdres4 даже поле обновления страницы была не активна если в поле "[name='CFV[467675]']" есть числа
define(['jquery'], function($){
var CustomWidget = function () {
var self = this;
var track;
this.callbacks = {
render: function () {
cururl = window.location.pathname;
w_code = self.get_settings().widget_code;
var template = '<section class="bbffrreeda">'+
'<div id="gcw_mainFvLC6GcEF" class="gcw_mainFvLC6GcEF"></div>'+
'<!-- <script>function reloadFvLC6GcEF(){ var sc = document.getElementById("scFvLC6GcEF");if (sc) sc.parentNode.removeChild(sc);sc = document.createElement("script");sc.type = "text/javascript";sc.charset = "UTF-8";sc.async = true;sc.id="scFvLC6GcEF";sc.src = "https://freecurrencyrates.com/ru/widget-vertical-editable?iso=KZTRUBUSDEURCNY&df=1&p=FvLC6GcEF&v=fits&source=fcr&width=245&width_title=0&firstrowvalue=1&thm=666666,000000,333333,333333,FFFFFF,666666,555555,ffffff,ffffff&title=%D0%9A%D0%BE%D0%BD%D0%B2%D0%B5%D1%80%D1%82%D0%B5%D1%80%20%D0%B2%D0%B0%D0%BB%D1%8E%D1%82&tzo=-360";var div = document.getElementById("gcw_mainFvLC6GcEF");div.parentNode.insertBefore(sc, div);} reloadFvLC6GcEF(); </script>-->'+
'<!-- put custom styles here: .gcw_mainFvLC6GcEF{}, .gcw_headerFvLC6GcEF{}, .gcw_ratesFvLC6GcEF{}, .gcw_sourceFvLC6GcEF{} -->'+
'<input id="test11" name="CFV[412312312]" class="linked-form__cf text-input" type="text" value="" placeholder="..." spellcheck="false" autocomplete="off">'+
'</section>'+
'<button style="font-size: 14px; width: 100%;" class="button-swwq3" id="trAdres4">✍Записать в Бюджет</button>'+
'<link type="text/css" rel="stylesheet" href="/upl/'+w_code+'/widget/style.css" >';
self.render_template({
caption:{
class_name:'js-ac-caption',
html:''
},
body:'',
render : template
});
$('.card-widgets__widget.card-widgets__widget-'+w_code).addClass('bbffrreeda');
// $('[name="CFV[467675]"]').change().val(trAdres4.disabled = !!this.value);
return true;
},
init: function(){
return true;
},
bind_actions: function(){
$('#trAdres4').on('click',function(e){
self.checker();
$('.card-fields__button-block').removeClass('hidden');
$('#save_and_close_contacts_link').removeClass('button-input-disabled').addClass('button-input_add button-input_blue');
$('#trAdres4').prop({"disabled":true});
});
return true;
},
settings: function(){
return true;
},
onSave: function(){
return true;
},
destroy: function(){
},
contacts: {
selected: function(){
}
},
leads: {
selected: function(){
}
},
tasks: {
selected: function(){
}
}
};
self.checker=function(){
//var t = $("#gcw_valFvLC6GcEF0").val().replace(/\s/g, "");
//var firstNum = parseFloat(t).split(',');
//var secondNum = t.replace(firstNum+'.','');
var t = $("#test11").val().replace(/\s/g, "");
var firstNum = parseFloat(t);
var secondNum = t.replace(firstNum+'[.]','123');
//var SUMALL = $("#gcw_valFvLC6GcEF0").val();
//alert(firstNum);
//alert(secondNum);
$("[name='lead[PRICE]']").change().val(Math.round(firstNum));
$("[name='CFV[467675]']").change().val(Math.round(firstNum)).css({"width": "100px"});
}
return this;
};
return CustomWidget;
});