Previous Topic: Macro buttons

Next Topic: Script buttons

Examples

You can change the default Y1MENU_O.HTM screen so that the command line is removed (so external users cannot access the command line), but you can add a macro button to enable users to execute a specific command. Even if you remove the command-line input field from the HTML page, you can add the following button to the Y1MENU_O skeleton:

<INPUT TYPE=”SUBMIT” VALUE=”Change profile” NAME=”_M1607:?QSYS/CHGPRF”>

A macro button can only be used to insert a single pre-specified string into a single input-capable field on a screen. However, the string can be a Web Option tag, so the following HTML code can copy the contents of one output field to a different input field and submit the page to the IBM i for processing:

<FONT COLOR=”BLUE” SIZE=”+2”>(_v1513)</FONT>
<INPUT TYPE=”TEXT” VALUE=”(_v1593)” NAME=”_F1593” SIZE=”20”>&nbsp;
<INPUT TYPE=”SUBMIT” VALUE=”Customer” NAME=”_M1593:(_v1513)”>

When the page displays in the previous case, if the contents of the output field on the green-screen at offset 1513 are “Firstname Lastname”, then the HTML output is:

<FONT COLOR=”BLUE” SIZE=”+2”>Firstname Lastname</FONT>
<INPUT TYPE=”TEXT” VALUE=”(_v1593)” NAME=”_F1593” SIZE=”20”>&nbsp;
<INPUT TYPE=”SUBMIT” VALUE=”Customer” NAME=”_X1593:Firstname Lastname”>

The user now has the option of either entering a new name in the _F1593 field or pressing the Customer button, which submits the page to the Web Option router with the _F1593 field having the value Firstname Lastname.