FormInfotron

This blueprint takes form elements from an input terminal provided array, and parses the different kinds properly (radio, option, et.c.).

The name of the input fields defined by their "name" attribute will be used as the key for the object literal emitted when the form is submitted.

Note! This blueprint also handles input elements which it wraps, so the easiest way to start using it, is to define it in a form tag, and then happily add inside it whatever input elements you fancy manually.

If the property value allow_direct_submission is set to false, all enclosed submit buttons are disabled, and the input terminal submit_request_in is used to trigger submission to the output terminal.

Sample Declaration

<div id="form1"  
     impl="~01BD0F00025EAA4b53A6E116F739172DCA"
     connections=" 'fields_out' : [['othercomponent', 'input']]"    
     script="http://localhost/Form.js">
<form>
<input type="text" value="keyword" />
<input type="submit" />
</form>
</div>
## Input Terminals + **fields_in**: + expected message type 1. An associative Array with values for each of the currently defined elements within the form. + **submit_request_in** + expected message type Any, or none; used to trigger a submit event ## Output Terminals + **fields_out** + An array of fields and values ## Properties + **allow_direct_submission** + can be set to the following value types: 1. true 2. false ## Demos that use it + form.html + hierarchical_encapsulation.html + http.html + yahoosearch.html + map.html + multi_map.html ## How does it work? When the form enclosed within the infotron is submitted, the values found in the input fields are encoded as a JavaScript object literal (i.e. similar to a dictionary in Python) and emitted through this output terminal.


Copyright © 2006–2008 by Assembla, LLC / Phone 1.781.328.2241 / E-mail: info@assembla.com