November 18, 200322 yr 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.
November 19, 200322 yr Consider: &-op===&firstname=[FMP-field: firstname]&-op===&lastname=[FMP-field:lastname]
November 19, 200322 yr You can use some Javascript to "condition" the values before the Form is submitted. All the best. Garry
November 19, 200322 yr 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.
November 19, 200322 yr 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
November 19, 200322 yr 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
November 20, 200322 yr Script is OK if you want to have result stored and indexed. Otherwise just use calculation field.
November 20, 200322 yr 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!
Create an account or sign in to comment