delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

My attempt in CF8 works most of time but if the firstname or lastname has a space in it such as John Paul as a firstname, then it wont work:
Code:

Firstname entry: #REReplace("Form.myName",",\w","","ALL")#<br>
Lastname entry: #REReplace("Form.myName","\w,","","ALL")#


I have a form field name coming in from someone else's page with lastname,firstname format such as this: Jones,Joe
I need to manipulate it to look like this:

Firstname entry:  Joe
Lastname entry:  Jones

My attempt in CF8 works most of time but if the firstname or lastname has a space in it such as John Paul as a firstname, then it wont work:
Code:
  1. Firstname entry: #REReplace("Form.myName",",\w","","ALL")#<br>
  2. Lastname entry: #REReplace("Form.myName","\w,","","ALL")#
Copy Code

TOP

You can try to use ListFirst(), ListLast(), or ListGetAt().
Code:
  1. <cfset lastname = ListFirst(form.name)>
  2. <cfset firstName = ListLast(form.name)>
Copy Code




My attempt in CF8 works most of time but if the firstname or lastname has a space in it such as John Paul as a firstname, then it wont work:
Code:

Firstname entry: #REReplace("Form.myName",",\w","","ALL")#<br>
Lastname entry: #REReplace("Form.myName","\w,","","ALL")#

TOP

Back Forum