dwhetzel Posted June 21, 2012 Share Posted June 21, 2012 Trying to make an XML template that puts two fields together with a space in between. Here is the code below I get the two fields combined but I lose the space between. I have tried every thing I could find to get this to work. If I convert to JavaScript in the rule builder I see the space is gone. I can type it back in in the script and it works. Can anyone point me in the right direction to fix this? TIA <?xml version="1.0" encoding="ISO-8859-1" ?> <template_rule name="1_Combine Text with space Rule" version="1.0" taggedtext="false" type="text"> <rulename language="en-US">Combine Text with space</rulename> <Comment language="en-US">Use this to combine two fields with a space between</Comment> <Description language="en-US">Choose 2 fields to combine.</Description> <fieldlist> <field type="FIELDLIST" required="true"> <fieldname>Var1</fieldname> <prompt language="en-US">Left field to combine</prompt> <value></value> </field> <field type="FIELDLIST"> <fieldname>Var2</fieldname> <prompt language="en-US">Right field to combine</prompt> <value></value> </field> </fieldlist> <code> var fullName = Field(Var1) + " " + Field(Var2); return fullName; </code> </template_rule> Link to comment Share on other sites More sharing options...
Dan Korn Posted June 21, 2012 Share Posted June 21, 2012 The template as posted works fine for me with FusionPro 8 on Mac, and the space shows up in the converted JavaScript rule. However, in earlier versions, the XML may have been parsed differently. In any case, changing the code to this should make it work in any version: var fullName = Field(Var1) + "&[size=2]#[/size]32;" + Field(Var2); return fullName; Link to comment Share on other sites More sharing options...
dwhetzel Posted June 21, 2012 Author Share Posted June 21, 2012 Dan, Thanks for your fast reply. Per another post of yours I had tried that. Just tried again and still wont work. I even tried it with taggedtext=true and false. I tried to find the same senario in one of the included templates but did not find any. I guess I will just have to teach the operators to convert to JS and fix it there. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.