See if this code snippet helps you out:
---index.cfm---
<form action="index.cfm" method="post">
<cfloop from="1" to="10" index="i">
<cfoutput>
<input type="hidden"
name="POSID#RandRange(100,9999)#LOCID#RandRange(100,9999)#"
value="#RandRange(100,9999)#">
</cfoutput>
</cfloop>
<input type="Submit" value="Submit" name="submit">
</form>
<cfif IsDefined("form.submit")>
<cfloop list="#form.fieldnames#" index="i">
<cfif Left(i,5) EQ "POSID">
<cfscript>
tmp = i;
posid =
RemoveChars(REReplaceNoCase(tmp,"LOCID.*","","ALL"),1,5);
tmp = i;
locid =
REReplaceNoCase(REReplaceNoCase(tmp,".*LOCID","","ALL"),"=.*","","ALL");
tmp = i;
canid = Evaluate("form." & i);
</cfscript>
<cfoutput>
POS_ID: #posid#<br>
LOC_ID: #locid#<br>
CAN_ID: #canid#<br><br>
</cfoutput>
</cfif>
</cfloop>
</cfif>
---index.cfm---
Erki
----- Original Message -----
From: "Deanna L. Schneider" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 19, 2000 4:23 PM
Subject: Is this an opportunity for regular expressions?
> Hi Folks,
> I have a dynamic voting application. The positions and locations open
can
> change, so I want it to be fully dynamic when the form is built and
when the
> data is inserted into the database. So, I can get the output onto the
form
> no prob. These are some examples of form fields and values that are
passed
> then:
> POSID2LOCID1=2
> POSID2LOCID2=3
> POSID5LOCID1=11
> POSID4LOCID2=8
> POSID2LOCID3=4
> POSID4LOCID3=9
> POSID3LOCID4=5
> POSID3LOCID5=6
> POSID1LOCID7=1
> POSID3LOCID6=7
>
> What I want to be able to do is loop through all the passed form
fields,
> parse out the posid number (insert it in the posid field in the db),
parse
> out the locid number (insert it in the locid field in the db) and
insert the
> value in the canid field. Seems like I should be able to do this with
> regular expressions, the logic being something like:
> Insert into posid value (take everything out of the field name but the
> number associated with the posid). Yes, I've thought of removechar(),
but I
> won't actually know how many digits the number is.
>
> So, since I've never used regular expressions, anyone want to help me
out?
>
> Thanks
> -d
>
>
>
>
> ************************************************************
> Deanna Schneider
> Interactive Media Developer
> UWEX Cooperative Extension Electronic Publishing Group
> 103 Extension Bldg
> 432 N. Lake Street
> Madison, WI 53706
> (608) 265-7923
>
>
>
> ----------------------------------------------------------------------
--------
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.
>
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.