Get value from attribute
-
Hi,
I am trying to get width and height of an image into CCF and then do some calculation based on that.
The width and height are stored in attributes of another DIV on the same page CCF is on.
<div class="mydiv" mywidth"dynamic"></div>
I tried adding the following to a calculated field:
(function(){ var width = jQuery('.mydiv').attr('mywidth'); return width; })();
This gets the value on page load. But if the attribute value changes, the calculated field doesn’t revaluate automatically (understandably).
I don’t want to use a button to revaluate field. I tried adding an on change event
(function() { jQuery("#file").change(function() { var width = jQuery('.mydiv').attr('mywidth'); return(width); }); })();
but it didn’t work. I guess I am missing something? how to make the field reevaluate every time the attribute changes ?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Get value from attribute’ is closed to new replies.