Dynamic form. name

I want to create a dynamic Serial Number entry screen.  The number of input boxes will be determined by the number of SN that need to be entered.  The problem is accessing the sn's in the action screen. How can I access the sn in the action screen.


FORM SCREEN

<CFLOOP INDEX="SN_Item" FROM="1" TO="#variables.sn_qty#" STEP="1">
<TABLE>
<TR>
      <TD>Serial Number Item: #SN_Item#</TD>
      <TD><INPUT TYPE="text"
       NAME="SN#SN_ITEM#"
       SIZE="10"
       MAXLENGTH="10"></TD>
</TR>
</TABLE>
</CFLOOP>

I can validate the form variables but I can't reach the data.

ACTION SCREEN

<CFIF NOT IsDefined("Form.SN_Qty")>
  SN QTY: You reached this page in error.
  <cfabort>
</CFIF>

<!--- validate Form.SN --->
<CFLOOP INDEX="SN_Item" FROM="1" TO="#Form.SN_Qty#" STEP="1">
  <CFIF NOT IsDefined("Form.SN#SN_ITEM#")>
    <br>SN:#SN_ITEM#: You have reached this page in error.
    <cfabort>
  <CFELSE>
          READ/GET DATA HERE!!!
  </CFIF>
</CFLOOP>


Chris

ChirsJBAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

moquinCommented:
The way to reach the data is to use Evaluate("Form.SN#SN_ITEM#").  That will dynamically evaluate the variable name and return its value.

e.g., inside your validation cfloop after the cfelse:

<cfset thesn=evaluate("Form.SN#SN_ITEM#")>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.