dreimer Posted January 31, 2017 Share Posted January 31, 2017 I am trying to format a line of text that uses different superscript settings from other text boxes using the global settings in my template. I tried to pick up a different example but am having trouble getting it to work. Here is my code, I am trying to place a data field in the spot where it says "MY FIELD" but I can't get the syntax correct. My field name is "Adult Cut Cents" return "<p br=false superoffset=30 superratio=70><superscript>$</superscript>" + Field("Adult Cut Dollar") + "<p br=false superoffset=30 superratio=70><superscript>MY FIELD</superscript>" Any help would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
step Posted January 31, 2017 Share Posted January 31, 2017 You don't need to set the superscript offset and ratio twice for the same paragraph. You can just write it like this: return '<p br=false superoffset=30 superratio=70>' + '<superscript>$</superscript>' + Field("Adult Cut Dollar") + '<superscript>' + Field("Adult Cut Cents") + '</superscript>'; Quote Link to comment Share on other sites More sharing options...
dreimer Posted January 31, 2017 Author Share Posted January 31, 2017 Thanks as always, that works. How would I write it though if I need the "$" and the "Dollar Cents Field" to be different for some reason. Just covering my bases. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 31, 2017 Share Posted January 31, 2017 Thanks as always, that works. How would I write it though if I need the "$" and the "Dollar Cents Field" to be different for some reason. Just covering my bases. You want it to be "different" how exactly? You mean like a different font or point size? Just emit the appropriate tags. You can use a <span> tag or <magnify> tag as needed. For instance: return '<p br=false superoffset=30 superratio=70>' + '<superscript>$</superscript>' + '<span font="Times">' + Field("Adult Cut Dollar") + '</span>' + '<superscript>' + Field("Adult Cut Cents") + '</superscript>'; Or: return '<p br=false superoffset=30 superratio=70>' + '<superscript>$</superscript>' + '<magnify type=text factor=150>' + Field("Adult Cut Dollar") + '</magnify>' + '<superscript>' + Field("Adult Cut Cents") + '</superscript>'; If you ask a more specific question, I can give a more specific answer. Quote Link to comment Share on other sites More sharing options...
dreimer Posted January 31, 2017 Author Share Posted January 31, 2017 I was looking to be able to change the attributes of the superscripting for the "Adult Cut Cents" field the same way the "$" can be changed. Like the code I posted initially having the '<p br=false superoffset=30 superratio=70>' available. Maybe Javascript won't allow it? I couldn't get the syntax to work with adding the field instead of the text "MY FIELD" Quote Link to comment Share on other sites More sharing options...
step Posted January 31, 2017 Share Posted January 31, 2017 Maybe Javascript won't allow it? I couldn't get the syntax to work with adding the field instead of the text "MY FIELD" Sure it will. You may have just had a typo in your syntax. Try this: return '<p br=false superoffset=30 superratio=70>' + '<superscript>$</superscript>' + Field("Adult Cut Dollar") + [color="Red"]'<p br=false superoffset=10 superratio=90>' + [/color] '<superscript>' + Field("Adult Cut Cents") + '</superscript>'; Quote Link to comment Share on other sites More sharing options...
dreimer Posted February 1, 2017 Author Share Posted February 1, 2017 Perfect, thanks. I knew I had a typo somewhere but couldn't figure it out. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.