Jump to content

Rewrite this Javascript rule


Naval

Recommended Posts

Hi there can anyone please help me rewrite this javascript rule below

 

if (Field("Mob") == "")

return "";

else

return '<f name="AC Bliss Medium"><z newsize="7"><color cmyk=000000FF>Mob </color></f>'+ '<f name="AC Bliss Light", <z newsize="7"><color cmyk=000000FF>' + Field("Mob")+ '<br>';'</color></f>';

 

Someone has written this rule but i want to know if there is a way to simplify this.

What this essentially is returning is Mobile phone field with a prefix Mob in AC Bliss Medium font and then the mobile number that the user enters in AC Bliss Light font.

 

Thanks for your help in advance.

 

Naval

Link to comment
Share on other sites

The best way to simplify your rule is to not have a rule at all. Just enter the prefix and the variable, with all the relevant formatting, in the Variable Text Editor dialog for the text frame, then click the Paragraph button, check the "Suppress if" box, and select "Containing Empty Variables" from the drop-down.
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...