"Rich" <no************@verizon.net> wrote in message
news:6Qd5e.74$0c2.23@trnddc08...
Here is something I found on the Web that is similiar to what I want to
do.
http://www.kmoser.com/xerox/cgi-bin/ps.cgi?action=home
Only difference is I'd like to ask the User questions and then suggest
some products.
Does this help?
I looked at the source code but could not figure out how this was done.
I think if I can get a sample of script on how to assign a radial button
to a specific set of products that I can do the rest......I hope.
Thanks again for any help.
Here's a stripped down version of the code at the above URL.
<HTML>
<HEAD>
<TITLE>SalesAss.htm</TITLE>
<script type="text/javascript">
function validate_and_submit() {
var ok = true; // Assume
var what; // E.g. 'Printer', 'Fax', etc.
var how; // E.g. 'Price', 'Function'
if (document.formname.primary[0].checked) {
what = 'Printer';
if (document.formname.priceOrFunc[0].checked) {
document.formname.state.value = 'pp1';
how = 'Price';
} else if (document.formname.priceOrFunc[1].checked) {
document.formname.state.value = 'pf1';
how = 'Function';
} else {
ok = false;
alert("Please select whether you would like to search by Price or by
Function before you click the 'Proceed' button.");
}
} else if (document.formname.primary[1].checked) {
what = 'Fax';
if (document.formname.priceOrFunc[0].checked) {
document.formname.state.value = 'fp1';
how = 'Price';
} else if (document.formname.priceOrFunc[1].checked) {
document.formname.state.value = 'ff1';
how = 'Function';
} else {
ok = false;
alert("Please select whether you would like to search by Price or by
Function before you click the 'Proceed' button.");
}
} else if (document.formname.primary[2].checked) {
what = 'Copy';
if (document.formname.priceOrFunc[0].checked) {
document.formname.state.value = 'cp1';
how = 'Price';
} else if (document.formname.priceOrFunc[1].checked) {
document.formname.state.value = 'cf1';
how = 'Function';
} else {
ok = false;
alert("Please select whether you would like to search by Price or by
Function before you click the 'Proceed' button.");
}
} else if (document.formname.primary[3].checked) {
what = 'Multifunction';
if (document.formname.priceOrFunc[0].checked) {
document.formname.state.value = 'mp1';
how = 'Price';
} else if (document.formname.priceOrFunc[1].checked) {
document.formname.state.value = 'mf1';
how = 'Function';
} else {
ok = false;
alert("Please select whether you would like to search by Price or by
Function before you click the 'Proceed' button.");
}
} else {
ok = false;
alert("Please choose the type of product you are interested in before
you click the 'Proceed' button.");
}
if (ok) {
document.formname.heading.value = (what + ' - by ' + how);
}
}
</script>
</HEAD>
<BODY>
<FORM name="formname">
<INPUT type="radio" name="primary" value="print"> Print
<INPUT type="radio" name="primary" value="fax"> Fax
<INPUT type="radio" name="primary" value="copy"> Copy
<INPUT type="radio" name="primary" value="multifunction"> Multi-Function
<br><br>
<INPUT type="radio" name="priceOrFunc" value="price">Price
<INPUT type="radio" name="priceOrFunc" value="function">Function
<br><br>
<INPUT type="text" name="state" readonly>
<input type="text" name="heading" value="">
<INPUT type="button" value="Proceed" onclick="validate_and_submit()">
<INPUT type="reset" value="Clear">
</FORM>
</body>
</html>
Your next step is to RTFM and talk to the teacher. Good luck!