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

Ask a Question related to Coldfusion Flash Integration, Design and Development.

  1. #1

    Default cfformitem type="script": How to set hidden field'svalue?

    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>

    cf_dev2 Guest

  2. Similar Questions and Discussions

    1. cfformitem type="html"
      I am having sound trouble using the above tag to display images... Using fusebox 3, getting a prod. description from a database, which includes a...
    2. <cfformitem type ="script">???
      Hi all I am having difficulties with an app that i downloaded from asfusion.com. The apps url is http://www.asfusion.com/apps/realestate/...
    3. Using CFSAVECONTENT with CFFORMITEM type="HTML"
      I am trying to create a preview area made up of a mix of HTML and cfform variables in a binding string. This is similar to the ASFusion article in...
    4. CFINPUT type="radio" w/ "value" requires "label"
      On a Flash form, when you specify type='radio' and value='whatever', the value of the 'value' attribute will be displayed as a label if no 'label'...
    5. #25366 [NEW]: form buttons of type "image" dont send "submit" $_POST variable in IE
      From: jordanolsommer at imap dot cc Operating system: Windows XP PHP version: 4.3.2 PHP Bug Type: Variables related Bug...
  3. #2

    Default Re: cfformitem type="script": How to set hidden field'svalue?

    The correct syntax is

    myForm.theID = "theID = "+ valueString;

    Ken

    The ScareCrow Guest

  4. #3

    Default Re: cfformitem type="script": How to set hidden field'svalue?

    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.



    cf_dev2 Guest

  5. #4

    Default Re: cfformitem type="script": How to set hidden field'svalue?

    You will need to use a combination of resources.


    1. CF Documentation

    [url]http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhel[/url]
    p.htm?context=ColdFusion_Documentation&file=part_d ev.htm

    2. Flash Documentation

    3. Flex Documentation

    Ken

    The ScareCrow Guest

  6. #5

    Default Re: cfformitem type="script": How to set hidden field'svalue?

    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 ;-)


    cf_dev2 Guest

  7. #6

    Default Re: cfformitem type="script": How to set hidden field'svalue?

    So that's my problem, someone stole my Russian-to-Swahili dictionary

    Ken
    The ScareCrow Guest

  8. #7

    Default Re: cfformitem type="script": How to set hidden field'svalue?

    Now that's funny ;-) I did hear a rumor that the next version is in Chinese. So you might skip the replacement and purchase a Russian-to-Chinese dictionary instead.
    cf_dev2 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139