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? <cfdump var="#form#"> <cfform name="myForm" format="flash"> <cfformitem type="script"> function test(theValue:String):Void { var valueString:String = theValue.toString(); title.text = "title = "+ valueString; description.text = "description = "+ valueString; myForm.theType.text = "theType = "+ valueString; myForm.theID.text = "theID = "+ valueString; } </cfformitem> <cftree name="itemTree" onchange="test(itemTree.selectedNode.getProperty('data').value)"> <cftreeitem display="ItemA" value="ItemA" parent="" expand="no" /> <cftreeitem display="ItemB" value="ItemB" parent="ItemA" expand="no" /> <cftreeitem display="ItemC" value="ItemC" parent="ItemB" expand="no" /> <cftreeitem display="ItemD" value="ItemD" parent="ItemB" expand="no" /> </cftree> <cfformgroup type="panel" label="Add / Edit"> <cfformgroup type="horizontal"> <cfformitem type="text" style="fontWeight:bold;" width="80">Title:</cfformitem> <cfinput name="title" type="text" width="200" value=" " /> </cfformgroup> <cfformgroup type="horizontal"> <cfformitem type="text" style="fontWeight:bold;" width="80">Description:</cfformitem> <cftextarea name="description" type="text" height="100" /> </cfformgroup> <cfinput type="hidden" name="theType" value="not set" /> <cfinput type="hidden" name="theID" value="not set" /> <cfinput type="submit" name="submitButton" value="Submit"> </cfformgroup> </cfform>
The correct syntax is myForm.theID = "theID = "+ valueString; Ken
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.
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 ;-)
So that's my problem, someone stole my Russian-to-Swahili dictionary
Don't see what you're looking for? Try a search.
|