Ken McNaught - 2009-12-18


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:

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""&gt;<br />
&lt;html xmlns=""&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 />

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.