Zot-Dispatch Indirect Assignment

So far you have been shown how to configure Zot-Dispatch by placing the values of the three fields (Dispatch Method,Destination, and Response Template) directly into the hidden variable ZD-Method. There may be situations, however, where you can't or don't want to place the value(s) of one/more of those fields directly into the ZD-Method variable itself. Here are a few example situations:

A:You have a FORM that e-mails a copy of the results to the user of the FORM. In order to do this the user has to be able to enter in an e-mail address which can then be entered into a ZD-Method hidden variable.

B:You have a FORM that allows the user of the FORM to select in which format the results are returned. In order to do this, the Response Template field of ZD-Method needs the ability to have its value change.

These are examples of two situations in which the value of a field of ZD-Method needs to change. Our solution is quite simple: In each of the fields of ZD-Method you have the option of placing the name of a different input field in which the value of that ZD-Method field is defined. The name of the input field must be preceded by a dollar sign ($) and followed by a pound sign (#). Here are solutions to examples A and B above:

For A the HTML might look like the following:

   <INPUT TYPE=hidden NAME=ZD-Method VALUE="ZD-Mail;$e-mail-address#;">
   <INPUT TYPE=text NAME="e-mail-address">
Here, the value that the user types in for e-mail-address is substituted into the Destination field of ZD-Method.

For B the HTML might look like the following:

   <INPUT TYPE=hidden NAME=ZD-Method 
        VALUE="ZD-Mail;lmegliol@uci.edu;$response-format#">
   <INPUT TYPE=radio NAME="response-format" 
        VALUE="file:/dir1/dir2/file1" checked>
   <INPUT TYPE=radio NAME="response-format" 
        VALUE="file:/dir1/dir2/file2">
Here, the type of response template used is determined by which radio button the user selects. Whichever is selected is substituted into the Response Template field of the ZD-Method variable.

Any of the three ZD-Method fields can be substituted in this manner to suit whatever needs you may have.


Possible Complications

As you should know, it is possible to have multiple input variables with the same name. If it should happen that there is more than one variable of the same name being indirectly assigned into a ZD-Method variable, different things might happen:

The fact that Zot-Dispatch only takes the last values to be substituted is not necessarily a poor feature of Zot-Dispatch. In fact, it allows for such things as default responses. For example: What if you would like to show the user a response only if a button is "clicked," and if not, show the user a default response. We can do this using the knowledge that Zot-Dispatch only takes the last value of the Response Template field given to it:
   <INPUT TYPE=hidden NAME=ZD-Method VALUE="ZD-Reflect;;$template-variable#">
   <INPUT TYPE=hidden NAME=template-variable VALUE="file:/dir1/dir2/default-template">
   <INPUT TYPE=checkbox NAME=template-variable 
        VALUE="file:/dir1/dir2/selectable-template">
If the user does not select /dir1/dir2/selectable-template then /dir1/dir2/default-template will be the only value returned to Zot-Dispatch causing it to be reflected. If the checkbox is chosen, then both values will be returned causing the last one (/dir1/dir2/selectable-template) to be reflected instead. This same principle can be used on the Dispatch Method field also.
LMIII
(Last Revised November 7, 1994)