Good morning,
i am using CF2016 on a window PC.
At my job i have the role of adding new hires into our card reader box so that new employees can enter into our office. I often can get up to 10 new employee request per day. I devised a rather complicated way of converting each character of their last name into a number format so that i can quickly punch their name info into nine-digit keypad of the card reader box. The letter arrangement of the key pad is similar a touch-tone phone.
I currently have two Cf pages to do what i need. The first page is a basic form with 6 text boxes that will only allow 1 character per box for the person last name. the second page is a series of conditional statements that will assign a numerical value to each character.
What i want to accomplish is to have one text box that i can enter the entire last name of the new employee and then have Coldfusion separate each character from the input box of the previous page and assign then display the same numerical values. Below is an abbreviated version of my current code for each page. i have enter last name of "Nelson" into each individual box.
Is there a simpler way to do this?
<!---First Page. The Form--->
<form class="form-inline"action="fob_assign1.cfm"enctype="application/x-www-form-urlencoded"nam e="form1"method="post">
<form class="form-inline">
<input type="text"name="box1" maxlength="1"tabindex=1 size="4">
<input type="text"name="box2" maxlength="1"tabindex=2 size="4">
<input type="text"name="box3" maxlength="1"tabindex=3 size="4">
<input type="text"name="box4" maxlength="1"tabindex=4 size="4">
<input type="text"name="box5" maxlength="1"tabindex=5 size="4">
<input type="text"name="box6" maxlength="1"tabindex=6 size="4">
<div class="form-group">
<button class="btn btn-primary btn-lg btn-block" type="submit" value="Submit">Submit</button>
</div>
</form>
<!---Second Page. Condition Statements--->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<cfif '#form.box1#' EQ "A">2#
<cfelseif '#form.box1#' EQ "B">22#
<cfelseif '#form.box1#' EQ "C">222#
<cfelseif '#form.box1#' EQ "D">3#
<cfelseif '#form.box1#' EQ "E">33#
<cfelseif '#form.box1#' EQ "F">333#
<cfelseif '#form.box1#' EQ "G">4#
<cfelseif '#form.box1#' EQ "H">44#
<cfelseif '#form.box1#' EQ "I">444#
<cfelseif '#form.box1#' EQ "J">5#
<cfelseif '#form.box1#' EQ "K">55#
<cfelseif '#form.box1#' EQ "L">555#
<cfelseif '#form.box1#' EQ "M">6#
<cfelseif '#form.box1#' EQ "N">66#
<cfelseif '#form.box1#' EQ "O">666#
<cfelseif '#form.box1#' EQ "P">7#
<cfelseif '#form.box1#' EQ "Q">77#
<cfelseif '#form.box1#' EQ "R">777#
<cfelseif '#form.box1#' EQ "S">7777#
<cfelseif '#form.box1#' EQ "T">8#
<cfelseif '#form.box1#' EQ "U">88#
<cfelseif '#form.box1#' EQ "V">888#
<cfelseif '#form.box1#' EQ "W">9#
<cfelseif '#form.box1#' EQ "X">99#
<cfelseif '#form.box1#' EQ "Y">999#
<cfelseif '#form.box1#' EQ "Z">9999#
</cfif><br>
<cfif '#form.box2#' EQ "A">2#
<cfelseif '#form.box2#' EQ "B">22#
<cfelseif '#form.box2#' EQ "C">222#
<cfelseif '#form.box2#' EQ "D">3#
<cfelseif '#form.box2#' EQ "E">33#
<cfelseif '#form.box2#' EQ "F">333#
<cfelseif '#form.box2#' EQ "G">4#
<cfelseif '#form.box2#' EQ "H">44#
<cfelseif '#form.box2#' EQ "I">444#
<cfelseif '#form.box2#' EQ "J">5#
<cfelseif '#form.box2#' EQ "K">55#
<cfelseif '#form.box2#' EQ "L">555#
<cfelseif '#form.box2#' EQ "M">6#
<cfelseif '#form.box2#' EQ "N">66#
<cfelseif '#form.box2#' EQ "O">666#
<cfelseif '#form.box2#' EQ "P">7#
<cfelseif '#form.box2#' EQ "Q">77#
<cfelseif '#form.box2#' EQ "R">777#
<cfelseif '#form.box2#' EQ "S">7777#
<cfelseif '#form.box2#' EQ "T">8#
<cfelseif '#form.box2#' EQ "U">88#
<cfelseif '#form.box2#' EQ "V">888#
<cfelseif '#form.box2#' EQ "W">9#
<cfelseif '#form.box2#' EQ "X">99#
<cfelseif '#form.box2#' EQ "Y">999#
<cfelseif '#form.box2#' EQ "Z">9999#
</cfif><br>
....... this continues on until the 12th box </cfif>
<!---Final Display--->
Below are the numbers on the key pad that i will enter for the last name "Nelson" is as follows
N = 66#
E = 33#
L = 555#
S = 7777#
O = 666#
N = 66#