Jump to content

change font help


Maria

Recommended Posts

I am needing to enter an open check box at the beginning of a line of text. The text may have 3 lines needing 3 boxes or it may only have 1. I thought I would change the font to Wingdings since it has an open checkbox in the "o" character position. Here is what I have:

 

if (Field("Choose your Region") == "Atlantic County NJ")

{

return "<span>" + RawText("<f name="Wingdings")>o</f> 4 E. Jimmie Leeds Rd , Suite 3, Galloway\n"+

"<f name="Wingdings")>o</f> 611 New Road, Northfield\n"+

"<f name="Wingdings")>o</f> 547 New Road, Suite 1, Somers Point\n") + "</span>";

}

if (Field("Choose your Region") == "Cape May County NJ")

{

return "<span>" + RawText("<f name="Wingdings")>o</f> 2087 Shore Road, Cedar Square Shopping Center, Ocean View\n") + "</span>";

}

return "";

 

 

I am getting an error SyntaxError: missing ) after argument list. What am I doing wrong?

Link to comment
Share on other sites

As the position of the cursor in the Rule Editor after the error message is shown indicates, the problem is here, on line 3 of your rule:

return "<span>" + RawText([color=Red]"<f name="Wingdings"[/color])>o</f> 4 E. Jimmie Leeds Rd , Suite 3, Galloway\n"+

You can't have unescaped double-quote characters in a string literal which itself is delimited by double-quotes. The JavaScript intepreter thinks that your string literal is "<f name=" and that what follows is code. (Specifically, it thinks that you're using or declaring a variable named Wingdings without ending the call to the RawText function.)

 

So to fix the syntax error, you can change that line so that the string literal is delimited with single quotes, like this:

return "<span>" + RawText('<f name="Wingdings")>o</f> 4 E. Jimmie Leeds Rd , Suite 3, Galloway\n'+

And you'll need to make a similar change on lines 4, 5, and 9 as well.

 

But even if you fix the syntax errors, there are other problems. You don't want to call the RawText function if you already have tagged markup, because you'll see the actual tags in the output. And those \n newlines should be <br> tags. Plus, you don't really need the <span> tags since you have the ending </f> tag to revert to the existing font. Try this:

if (Field("Choose your Region") == "Atlantic County NJ")
{
return '<f name="Wingdings")>o</f> 4 E. Jimmie Leeds Rd , Suite 3, Galloway<br>' +
'<f name="Wingdings")>o</f> 611 New Road, Northfield<br>' +
'<f name="Wingdings")>o</f> 547 New Road, Suite 1, Somers Point<br>';
}
if (Field("Choose your Region") == "Cape May County NJ")
{
return '<f name="Wingdings")>o</f> 2087 Shore Road, Cedar Square Shopping Center, Ocean View<br>';
}
return "";

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...