Previous ION Script User's Guide: Creating ION Script Applications Next

HTML Forms vs. ION Script Forms

ION Script forms, created with the ION_FORM tag, are beefed-up versions of the HTML form. An HTML form is limited to one action (defined by the ACTION attribute). An ION Script form can have a different EVENT for each ION_BUTTON, ION_IMAGE, and ION_LINK contained in the form.

In addition, ION Script forms can contain the ION_CHECKBOX and ION_RADIO elements, which, unlike their HTML counterparts, maintain state when the page is reloaded.

If, however, you have an existing HTML form, you can still access the form values that are submitted without creating an entirely new ION Script form to replace the HTML version. Following are two ION Script pages—one uses an ION Script form, the other uses an HTML form. page2.ion is the action of each form. Load both ionform.ion and htmlform.ion, press the button, and each form passes the $Form variable to page2.ion:

ionform.ion:

<ION_HEADER>  
   <EVENTS>  
      <EVENT_DECL NAME="PAGE2" ACTION="ion://page2.ion"/>  
   </EVENTS>  
</ION_HEADER>  
<ION_BODY>  
   <ION_FORM>  
      <INPUT NAME="Text1" TYPE="TEXT" VALUE="Hello">  
      <ION_BUTTON EVENT="PAGE2" TYPE="BUTTON"/>  
   </ION_FORM>  
</ION_BODY>  

htmlform.ion:

<ION_BODY>  
   <FORM ACTION="http://myserver/cgi-bin/ion-p">  
      <INPUT TYPE="HIDDEN" NAME="page" VALUE="page2.ion">  
      <INPUT NAME="Text1" TYPE="TEXT" VALUE="Hello">  
      <INPUT TYPE="SUBMIT">  
   </FORM>  
</ION_BODY>  

page2.ion:

<ION_BODY>  
<ION_VARIABLE NAME="$Form.Text1"/>  
</ION_BODY>  

  IDL Online Help (March 06, 2007)