• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

odd Form variables returned

Explorer ,
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

I am receiving FORM variables off of a post from a pdf doc. its sending vars like this...

FORM.F[0].P1[0].Field1[0]

With all those extra periods in there its creeping CF out and returning an error "Element F is undefined in a java object class..." when i go to loop through the FORM.FIELDNAMES.

is there a fancy function or something I can use to grab those variables? my evaluate isnt working:

<cfloop index="ii" list="#FORM.FIELDNAMES#" delimiters=",">
<cfoutput>#ToString(Evaluate('FORM.' & ii))#<br></cfoutput>
</cfloop>

TIA yawl
TOPICS
Advanced techniques

Views

540

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jun 02, 2006 Jun 02, 2006
Tim can you explain why that worked? Thanks thats great!

Votes

Translate

Translate
Guest
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

You might try this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

thanks jdeline,

I still get the same 2 exceptions:

Element F is undefined in a Java object of type Class [Ljava.lang.String;

-and-

Object Instatiation Exception

- Aaron

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

What happens when you do a <CFDUMP VAR=#FORM#> at the beginning of the page?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

it displays my FORM variables with their values. I have the following variables:

FIELDNAMES=F[0].P1[0].A10[0],F[0].P1[0].A11[0],F[0].P1[0].A12[0],F[0].P1[0].A1[0],F[0].P1[0].A2[0],F[0].P1[0].A3[0],F[0].P1[0].A44[0],F[0].P1[0].A46[0],F[0].P1[0].A4[0],F[0].P1[0].A5[0],F[0].P1[0].A6[0],F[0].P1[0].A7[0],F[0].P1[0].HTTPSUBMITBUTTON1[0]
F[0].P1[0].A10[0]=10
F[0].P1[0].A1[0]=1
F[0].P1[0].A2[0]=0
F[0].P1[0].A44[0]=0
F[0].P1[0].A46[0]=0
F[0].P1[0].A4[0]=0
F[0].P1[0].A5[0]=65
F[0].P1[0].A6[0]=0
F[0].P1[0].A7[0]=4654
F[0].P1[0].HTTPSUBMITBUTTON1[0]=

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

<cfloop index="ii" list="#FORM.FIELDNAMES#" delimiters=",">
<cfoutput>#form[ii]#<br></cfoutput>
</cfloop>

HTH
--
Tim Carley
www.recfusion.com
info@NOSPAMINGrecfusion.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

Tim can you explain why that worked? Thanks thats great!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

LATEST
you're accessing the form structure (e.g. form['fieldname']) rather than
the name of the form field, which CF can't get through because of the
multiple dots and brackets.
Plus, you get rid of Evaluate()...which can be a performance hit.
HTH
--
Tim Carley
www.recfusion.com
info@NOSPAMINGrecfusion.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

What a mess. ColdFusion probably is confused by the [ ], thinking it's dealing with an array element. Let me think about it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation