An example of a HTML page (Web form) referencing the Web Form Signing Applet is given below. In this example the applet is embedded into the Web form with the <applet> tag.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Personal Data Form</title>
</head>
<body>
<form name="formPersonalData">
<strong>Personal Data Form</strong>
First name: <input name="textBoxFirstName" type="text" />
Last name: <input name="textBoxLastName" type="text" />
Gender:
<select name="dropDownListGender">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
Marital status:
<input type="radio" name="radioMaritalStatus" value="Single" />Single<br />
<input type="radio" name="radioMaritalStatus" value="Married" />Married<br />
<input type="radio" name="radioMaritalStatus" value=" Divorced" />Divorced<br />
Comments:
<textarea name="textAreaComments" rows="2" cols="20"></textarea>
Upload CV (file upload):
<input type="file" name="fileUploadCV" />
<input type="checkbox" name="checkBoxTermsAgree" />
<label for="checkBoxTermsAgree">I agree to the terms and conditions</label>
<applet
code="com.digisign.applet.WebFormSignerApplet"
archive="WebFormSignerApplet.jar"
width="150"
height="30"
mayscript="true"
signButtonCaption="Sign form"
inputForm="formPersonalData"
ignoredFields="xml"
textBoxFormFieldsXML="xml"
outputForm="formSignature"
textBoxPkcs7Signature="textBoxPkcs7Signature"
maxFileSize="1"
debugMode="false">WebFormSignerApplet
</applet>
XML for signing (built from the form fields):
<textarea name="xml" style="height: 130px; width: 390px;"
readonly="true" wrap="off"></textarea>
</form>
<br/>
<form name="formSignature" method="post" action="DigitalVerifierServlet">
<strong>Signature Form</strong>
PKCS#7 Signed Data (the result of signing):
<textarea name="textBoxPkcs7Signature" style="height: 130px; width: 390px;"
readonly="true" wrap="off"></textarea>
<input type="submit" name="buttonSubmit" value="Send Signed Data" />
</form>
</body>
</html>
An example of a HTML page (Web form) referencing the Web Form Signing Applet is given below. In this example a combination of <object> and <embed> tags is used.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Personal Data Form</title>
</head>
<body>
<form name="formPersonalData">
First name: <input name="textBoxFirstName" type="text" />
Last name: <input name="textBoxLastName" type="text" />
Gender:
<select name="dropDownListGender">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
Marital status:
<input type="radio" name="radioMaritalStatus" value="Single" />Single<br />
<input type="radio" name="radioMaritalStatus" value="Married" />Married<br />
<input type="radio" name="radioMaritalStatus" value=" Divorced" />Divorced<br />
Comments:
<textarea name="textAreaComments" rows="2" cols="20"></textarea>
Upload CV (file upload):
<input type="file" name="fileUploadCV" />
<input type="checkbox" name="checkBoxTermsAgree" />
<label for="checkBoxTermsAgree">I agree to the terms and conditions</label>
<object
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_5-windows-
i586.cab#Version=1,5,0,0"
width="90" height="30" mayscript="true">
<param name="type" value="application/x-java-applet;version=1.5">
<param name="code" value="com.digisign.applet.WebFormSignerApplet">
<param name="archive" value="WebFormSignerApplet.jar">
<param name="mayscript" value="true">
<param name="signButtonCaption" value="Sign form">
<param name="inputForm" value="formPersonalData">
<param name="ignoredFields" value="xml">
<param name="textBoxPkcs7Signature" value="textBoxPkcs7Signature">
<param name="maxFileSize" value="1">
<param name="debugMode" value="false">
<comment> <embed
type="application/x-java-applet;version=1.5"
pluginspage="http://java.sun.com/products/plugin/index.html#download"
code="com.digisign.applet.WebFormSignerApplet"
archive="WebFormSignerApplet.jar" width="90" height="30"
mayscript="true" scriptable="true"
signButtonCaption="Sign form"
inputForm="formPersonalData"
ignoredFields="xml"
textBoxFormFieldsXML="xml"
outputForm="formSignature"
textBoxPkcs7Signature="textBoxPkcs7Signature"
maxFileSize="1"
debugMode="false">
<noembed>
Document signing applet can not be started because Java Plugin 1.5 is
not installed. </noembed> </embed> </comment>
</object>
XML for signing (built from the form fields):
<textarea name="xml" style="height: 130px; width: 390px;"
readonly="true" wrap="off"></textarea>
</form>
<br/>
<form name="formSignature" method="post" action="DigitalVerifierServlet">
<strong>Signature Form</strong>
PKCS#7 Signed Data (the result of signing):
<textarea name="textBoxPkcs7Signature" style="height: 130px; width: 390px;"
readonly="true" wrap="off"></textarea>
<input type="submit" name="buttonSubmit" value="Send Signed Data" />
</form>
</body>
</html>
Note:- Some web browsers will allow the applet to run JavaScript and to access the HTML document, but only if this is explicitly set by the parameters or attributes of the tag by which it is embedded in the web page. Such parameters are “mayscript” and “scriptable”, and they must have value “true”.