Jump to content

Create Rule to use Superscripting different from the gloabal setting.


dreimer

Recommended Posts

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.

Link to comment
Share on other sites

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>';

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

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>';

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...