/*****************************************************************************/
/* A Simple Form with Input                                        form1.cmd */ 
/*                                                                           */
/* (C) Copyright IBM Corporation 1999.                                       */
/*                                                                           */
/* This code is sample code, provided "AS IS", without warranty of any kind  */
/*****************************************************************************/

use arg type, list, address            /* get the arguments                  */

parm = .parmdir~new(list)              /* create parameter directory         */

html = .myHtml~new                     /* create an html object              */ 
html~title('A Form with Object REXX')
html~h1('A Simple' green('Form') 'with Input')

if parm['submit'] = 'Process' then do   
  html~p("You entered:")
  html~p("Name = "brown(parm['name']))
  html~p("Profession = "brown(parm['profession']))

  html~form("/cgi-bin/orxwww/form1")   /* cgi-form with 'Again' button       */ 
  html~submit("submit", "Again")
  html~eform
end
else do
  html~p('Enter the values and press "Process" to continue.')

  html~form("/cgi-bin/orxwww/form1")   /* cgi-form with 'Process' button     */
  html~pr(' Date:' date('L'))
  html~p("Name:")~iText("name", "")
  html~p("Profession:")~iText("profession")
  html~p~submit("submit", "Process")
  html~eform
end   

html~footing("/orxwww/form1.cmd")      /* footing with code reference        */
return html~end                        /* end HTML document and return it    */

::requires "myhtml.cls"                /* load myHtml class                  */
