Jump to content

johper

Registered Users - Approved
  • Posts

    2
  • Joined

Posts posted by johper

  1. Hi,

     

    I'm creating a business card template and I have a problem getting rid of of a separator at the end of a text line when there's a line break. The customer can select different brands in a html checkbox list and automatically the selected brands align with comma between them. I have managed to replace the comma with dash and no break space and allow only linebreak after the dash. But I also want to remove the dash at the end of the line in case there is a line break.

     

    Image: http://s30.postimg.org/ajtqvu94h/procar.jpg

     

     

    This is code I´m using so far:

     

     

    var mystring = (Field("Extra line"))

     

    function NoBreak(s)

    {

    return s.replace(/ /g, " ");

    }

    mystring2 = NoBreak(mystring);

     

    var newchar = ' - '

    mystring3 = mystring2.split(',').join(newchar);

     

    return mystring3;

     

     

     

    Any help would be appreciated.

    procar.jpg.4bbb09a1ba6c13a146d6cde013d6ba9c.jpg

×
×
  • Create New...