Skip to main content
Inspiring
April 19, 2007
Answered

cfformitem type="script": How to set hidden field's value?

  • April 19, 2007
  • 2 replies
  • 1362 views
I have a simple test form that contains a cftree and a few input/hidden fields. Whenever a tree node is selected, I want to change the values of input/hidden fields to whatever node was selected. Pretty simple, but I can't figure out how to change the values of the hidden fields.

Load the form, select "ItemA" and click submit. The values of the hidden form fields don't change. They're always "not set". What is the correct syntax for changing a hidden field's value?


This topic has been closed for replies.
Correct answer The_ScareCrow
The correct syntax is

myForm.theID = "theID = "+ valueString;

Ken

2 replies

Inspiring
April 22, 2007
You will need to use a combination of resources.


1. CF Documentation
Using Server-Side ActionScript

2. Flash Documentation

3. Flex Documentation

Ken
cf_dev2Author
Inspiring
April 26, 2007
Thanks Ken, that helped. With the updated CF help files and Flash documentation its starting to make a little more sense.

On a humorous note, I have to say it feels a little like the instructions are written in Swahili and I'm using an English-to-Russian dictionary and then a Russian-to-Swahili dictionary to read them ;-)
Inspiring
April 26, 2007
So that's my problem, someone stole my Russian-to-Swahili dictionary

Ken
The_ScareCrowCorrect answer
Inspiring
April 19, 2007
The correct syntax is

myForm.theID = "theID = "+ valueString;

Ken
cf_dev2Author
Inspiring
April 20, 2007
That was it. Thanks! Weird that there's a different syntax for hidden fields.

Do you know if there any online references or documentation for scripting? I've been using snippets from tutorials and trying to figure out the syntax from flex documentation.