Skip to main content
Participating Frequently
March 13, 2008
Question

Prepend to form value in query

  • March 13, 2008
  • 2 replies
  • 712 views
I want to prepend an input value of the user who doesnt input all numbers of his ID.

Our users are given with 14 digits as a username. The first 5 digits are common to all. They find it difficult type in all 14 digits. Since the first 5 digits are common to all, I want to allow them to input last 9 digits so that the form value prepends with first 5 common digits to the last 9 digits in a query only if all 14 digits are not typed.

Ex: 37251 357968487

I really appreciate your help.

Thanx.
This topic has been closed for replies.

2 replies

Inspiring
March 13, 2008
change this:
maxlength="14"
to
maxlength="9"

get rid of all the octothorps here
WHERE (dbo.user_code.user##=dbo.user.user##)

change this
dbo.user_code.code = '#form.login#'
to
<cfset logincode = "constant value" & form.login>

dbo.user_code.code = '#logincode#'
shashtriAuthor
Participating Frequently
March 13, 2008
WOW! thats what I wanted. Why couldn't I think of it? Tons of thanks to you Dan for everything and being so patient.
Inspiring
March 13, 2008
In your form, only ask for 9 digits.

In Cold Fusion, the ampersand is used to concatonate strings.
shashtriAuthor
Participating Frequently
March 13, 2008
How do I do that? Is it too much if I ask an example? I appreciate your help Dan.
Inspiring
March 13, 2008
quote:

Originally posted by: shashtri
How do I do that? Is it too much if I ask an example? I appreciate your help Dan.

You need to be more specific. I gave you two suggestions. Which one is giving you difficulty?