Hi,
I have added below javascript on textbox custom field's description.
setInterval(function(){console.log('value is:'+AJS.$("#customfield_11426\\:input1").val()); //unable to get updated value on each interval tick, it just prints initial value which is found while loading edit issue screen. },2000);
It executes on 2 sec but it just print same value of input1 textbox instead of updated values.
(just take the value which is found while loading issue edit screen but unable to get updated textbox values).
i need these updated value for further calculation.
Can you tell me what can be the cause and how to resolve .
Thank You
try with $('#customfield_11426').change(function() { var val = $('#customfield_11426').val(); }); or $("#customfield_11426").keyup(function(){ AJS.$(this).val() });
Hi @dhaval soni ,
Change event will work correctly, where keypress, keydown,keyup are all keyboard events which will have some syncing issues, whatever you have discussed earlier is an keyboard value syncing issue,blur can also be used but when the field loses it's focus only - blur event will be called, Change is the correct event, whenever a value changes, this event will be called.So, Change event will work correctly for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
your code will execute on page load, to get latest value of the field you have to place your code inside some event
something like follows
$('#customfield_11426').bind('keypress', function (e) { //add your code here });
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have replaced and how it works -
when update the textbox valut to '157' then console.log prints '15' for AJS.$(this).val() and not 7. when give value - 1578 then shows 157. so, last char not cosndering and also, when do backspace to remove char then also it does not update value. any other event have to cosnider..?
also, when i show in "firebug" then it inspect the value as same value which is on loading the screen and no updated value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.