Brian F. Posted November 6, 2009 Share Posted November 6, 2009 I received sample files and instructions on how to allow store users to enter their own dimensions for versioned ads. my question is this... Can logic be created so that when a user makes an adjustment to one dimension the other dimension will be adjusted proportionately? Link to comment Share on other sites More sharing options...
kjacobson Posted November 19, 2014 Share Posted November 19, 2014 I realize this is an old question, but did you (or anyone else) figure out how to adjust the dimensions proportionately? I would like to allow the user to type in the page_width__ value and then the page_height__ value would automatically be calculated. I would like to do this without having values in a drop down. The issue is assigning the page_height__ value to field("page_height__"). example: I have an 8.5" x 11" page. The user inputs 17 for the page_width__. The template should output as 17" x 22". After reading this post (http://forums.pti.com/showthread.php?t=2559&highlight=field+value), I have a feeling that it isn't possible. I've attached the Ad Resizing information that PTI provided. Note: The resizing will not work in Acrobat, you need to upload it to MarcomCentral for it to work.ad_resizing_rev.zip Link to comment Share on other sites More sharing options...
ThomasLewis Posted November 20, 2014 Share Posted November 20, 2014 I have not used this so no guarantees here. First make sure the page_width__ field has a lower sort order number than the page_height__ field. Put the following script in the Note part of the page_width__ field. Make sure the doc_width and doc_height numbers are correct for your template. <script type="text/javascript"> var doc_width = 8.5; var doc_height = 11; document.getElementById("page_width__").onblur = calc; function calc() { document.getElementById("page_height__").value = parseFloat(this.value) * (doc_height / doc_width);} </script> This should automatically fill out the page_height__ field when you click out of it. You will likely want to set that field to be hidden before publishing the form. Let me know how it works out. Link to comment Share on other sites More sharing options...
kjacobson Posted November 20, 2014 Share Posted November 20, 2014 It worked perfectly! Thank you. I would have never thought of putting javascript in the notes field. Link to comment Share on other sites More sharing options...
Recommended Posts