<script type="text/javascript" language="JavaScript" src="http://www.yoururl.com/sniffer.js"> </script> <script type="text/javascript" language="JavaScript" src="http://www.yoururl.com/ps_utilities.js"> </script>
Both of the JavaScript files referenced above are included with the standard Perlshop 4 release. The sniffer.js file contains code that determines the type of browser being used by the customer. The ps_utilities.js file contains the various functions used by Perlshop 4. Since the code in the ps_utilities.js file references the code in the sniffer.js file, both files must be included.
As of version 4.2.08, this function will also check for the optional QTY_MIN and QTY_MAX fields. If these limits have been exceeded, this function will alter the quantity value to fit the limits, move the browser focus to the QTY field in question , and post an error message in a pop-up window.
In versions 4.2.07 and earler, the OnAddItems() function expects the name of the order form to be "itemForm".
As of version 4.2.08, this function has an optional parameter that can be used to specify the name of the
order form object. If this parameter is not provided, the value will default to "itemForm".
<form method=post name="itemForm"
action="!MYURL!"
onSubmit="return OnAddItems();">
<input type=hidden name="item_id" value="pn324">
<input type=hidden name="item_name" value="Basic Widget">
<input type=hidden name="item_price" value="12.50">
<input type=hidden name="item_weight" value="3.5">
<input type=text name="qty" value="1" size=4 maxlength=4>
<input type=submit name="action" value="Order">
</form>
| HTML | Example |
|---|---|
<form name="printForm" method=get target="_top" onSubmit="javascript:return PrintPage();"> <input type=submit value="Print"> </form> |
| HTML | Example |
|---|---|
<a href="" onClick="return PrintPage()">Print</a> |
| HTML | Example |
|---|---|
<form name="noteForm" method=get target="_top"
onSubmit="javascript:NoteWindow('notedemo.html'); return false">
<input type=submit value="Display">
</form>
|
| HTML | Example |
|---|---|
<a href="" onClick="NoteWindow('notedemo.html'); return false">Display</a>
|
Display |