Jump to content

This topic is 7743 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi,

Is there a way to remove spaces from a field? I am using firstname and lastname fields in a url to pull up a search page, if they enter a space in the field by accident when they input their name, the url which is created from that is broken. I don't know much about scripts, but thought maybe it could be done.

http://www.url/xmas/FMPro?-db=card&-lay=data&-format=[FMP-field: format]&-error=search_error.htm&-op=eq&firstname=[FMP-field: firstname]&lastname=[FMP-field:lastname]&-Find

Thanks for the help.

Posted

The "[FMP-field: firstname and [FMP-field:lastname]"

should be ideally served already flittered to the web page e.g. with SUBSTITUE() function from calculated field.

Posted

I use this script for large text files that are dragged into a field. With these particular files the amount of spaces can be in the hundreds. the substitute looks for two spaces and replaces with one, pattern count also looks for 2 spaces and if none found exits loop, the trim function removes any beginning and ending spaces.

Set Field [ TxtBuffer, Trim(TxtBuffer) ]

Loop

Set Field [ TxtBuffer, Substitute(TxtBuffer, " ", " ") ]

Exit Loop If [ PatternCount(TxtBuffer, " ") = 0 ]

End Loop

Regard

Rod

Posted

I use this script for large text files that are dragged into a field. With these particular files the amount of spaces can be in the hundreds. the substitute looks for two spaces and replaces with one, pattern count also looks for 2 spaces and if none found exits loop, the trim function removes any beginning and ending spaces.

Set Field [ TxtBuffer, Trim(TxtBuffer) ]

Loop

Exit Loop If [ PatternCount(TxtBuffer, " ") = 0 ]

Set Field [ TxtBuffer, Substitute(TxtBuffer, " ", " ") ]

End Loop

Regard

Rod

Posted

Say that looks like a ScriptMaker Script, not a JavaScript. You must have written that for a site which has just one visitor.

If anyone around here is an expert on ScriptMaker on the web, it is ME.

Buddy, if that script is open to more than one user, you ain't tested your ScriptMaker script vigorously or effectively. You better get to work on that!

This topic is 7743 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.