army Posted November 18, 2003 Posted November 18, 2003 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.
Unable Posted November 19, 2003 Posted November 19, 2003 Consider: &-op===&firstname=[FMP-field: firstname]&-op===&lastname=[FMP-field:lastname]
Garry Claridge Posted November 19, 2003 Posted November 19, 2003 You can use some Javascript to "condition" the values before the Form is submitted. All the best. Garry
Anatoli Posted November 19, 2003 Posted November 19, 2003 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.
RodinBangkok Posted November 19, 2003 Posted November 19, 2003 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
RodinBangkok Posted November 19, 2003 Posted November 19, 2003 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
army Posted November 20, 2003 Author Posted November 20, 2003 Thanks to all of you for the suggestions. I will work on it.
Anatoli Posted November 20, 2003 Posted November 20, 2003 Script is OK if you want to have result stored and indexed. Otherwise just use calculation field.
Keith M. Davie Posted November 20, 2003 Posted November 20, 2003 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now