I'm embedding javascript into a custom field's "description" input field. This field is normally used for storing description labels for custom fields. However, It can also be used to store field-specific javascript (I'm using jQuery).
My problem is that, although my script seems to work on my preliminary tests, I can't locate the script in the DOM in order to verify its presence and do trace testing.
Using Chrome's developer tools inspector menu, I can click on the description and see the text in the inspector panel. However, I can't see the script there. I know its present somewhere in the DOM because my jQuery is formatting the description input as written.
Can anyone shed light on where the script is written to the DOM?
Here's the contents of the description field:
This is the calculated estimate field
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#customfield_21070").attr('style','width:60px');
jQuery("#customfield_21070").attr('disabled','disabled');
var customfields = [
'#customfield_11070',
'#customfield_11071',
'#customfield_20071',
'#customfield_20072',
'#customfield_20073',
'#customfield_20074',
];
for(var i=0, len=customfields.length; i<len; i++) {
console.log(customfields[i]);
jQuery(customfields[i]).keyup(function(){
calculateSum().call(this);
});
}
function calculateSum(field) {
var sum = 0;
if(!isNaN(field.value) && field.value.length!=0 && field.id !== "customfield_21070") {
sum += parseFloat(field.value);
}
jQuery("#customfield_21070").val(sum.toFixed(2));
}
});
</script>