juliemartin Posted August 15, 2009 Share Posted August 15, 2009 I have a client that has a specific way in which their bullet points are to be formatted. Example: :: Bullet :: Bullet :: Bullet Each bullet must have the 2 colons and space in front. Is there anyway to send an error note or automatically reformat them if the user doesn't follow this format? Please help! Link to comment Share on other sites More sharing options...
esmith Posted August 17, 2009 Share Posted August 17, 2009 It might be necessary to see a sampling of your data to see what kind of input should be expected, but I think the following code should cover most scenarios: //Replace "YOUR_FIELD" with name of your field (3x) //search for first instance of alphanumeric character (A-Z, a-z, 0-9) and returns index var TrashCharsLength = Field("YOUR_FIELD").search(/\w/); //determine length of field and subtract number of characters preceding "live" data var TextLength = Len(Field("YOUR_FIELD")); var CleanedData = Right(Field(YOUR_FIELD), TextLength - TrashCharsLength); //add correct "prefix" to "clean" data var BulletedText = ":: " + CleanedData; return BulletedText; Link to comment Share on other sites More sharing options...
juliemartin Posted August 24, 2009 Author Share Posted August 24, 2009 Thank you - this is very close to what I need! Next question: This coding changes the bullet format for the first entry to :: but the user is allowed to enter multiple bullets within the same field and I need the format to be changed in front of each one, not just the first. Do I need to use separate fields for each bullet point and apply this rule? Example: :: Strength - Agility - Plyometrics Link to comment Share on other sites More sharing options...
esmith Posted August 24, 2009 Share Posted August 24, 2009 Do I need to use separate fields for each bullet point and apply this rule? Example: :: Strength - Agility - Plyometrics I was under the impression that each bullet was it's own field. While we can use JS to replace a string of characters with another (i.e. swap " - " with ":: ") I don't know that we can account for all the possible scenarios that a user might choose to enter his data. Link to comment Share on other sites More sharing options...
juliemartin Posted August 24, 2009 Author Share Posted August 24, 2009 Yeah that is kind of what I figured. I'll try using separate fields for each bullet and see how that goes. Thanks so much for your help! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.