How to use REXX as scripts in HTML pages?

Help
2009-12-18
2013-05-14
  • Ken McNaught
    Ken McNaught
    2009-12-18

    Hello,

    I wish to REXX for scripting HTML pages rather than JavaScript.  (Not a REXX CGI to "prepare" the page - I've got that working Okay) but rather I want to interact with the user using REXX scripts, in the same way it is possible to do with JavaScript scripts.

    By way of example, in the following HTML page I would like the text "Hello World" to be written to the page when the page is loaded, and the content of the text box to be altered when the button is pressed.  At present, I cannot get any of this working:

    <tt>
    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;<br />
    &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;<br />
    &lt;head&gt;<br />
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;<br />
    &lt;title&gt;Test REXX&lt;/title&gt;<br />
    <br />
    &lt;script type="text/rexx" language="rexx"&gt;<br />
    Func1:<br />
      document.write("Hello World")<br />
      Return 0<br />
      <br />
    Press:<br />
      document.f1.inp.value = "New value inserted"<br />
      Return 0<br />
    &lt;/script&gt;<br />
    &lt;/head&gt;<br />
    <br />
    &lt;body onload="Func1()"&gt;<br />
    Sample text<br />
    &lt;form name="f1"&gt;<br />
    &lt;input type="button" onclick="Press()" value="Press to change" /&gt;&lt;br /&gt;<br />
    &lt;input type="text" name="inp" size=30 value="Replace me" /&gt;<br />
    &lt;/form&gt;<br />
    &lt;/body&gt;<br />
    &lt;/html&gt;<br />
    <br />
    </tt>

    So can I use REXX to this kind of thing at all?<br />
    If so, please can you answer questions such as:<br />
    How is the &lt;script type="????"&gt; tag coded?<br />
    How do I call the REXX functions from onload/onclick etc?<br />
    How do I dynamically update the page or form fields from the REXX functions?<br />
    Can you point me at any documentation, tutorials or working examples?<br />
    <br />
    Many thanks for your assistance.
    Ken.