Decision Support Systems For Business Intelligence
    by Vicki L. Sauter

 
 
Codebox 5.3

<!DOCTYPE HTML PUBLIC "-     //W3C     //DTD HTML 4.0 Transitional     //EN"><html><head>
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<title>JavaScript Examples</title>
<style type="text/css">
<!--
H1, h2, h3, h4, h5, h6 {font-family:"arial"}
td {font-family:"arial"}
td {font--size: 10pt}
td {font-weight: bold}
td {border-width: 2px}
table {border-color: #8d89c7}
body {font-family:"arial"; font-size: 10pt; font-weight:bold}
p {font-family:"arial"; font-size: 10pt; font-weight:bold}
-->
</style>
<script>
function define_option()
{
if (document.forms[0].elements.car_preference[0].checked)
{car1 = “Audi” }
else if (document.forms[0].elements.car_preference[0].checked)
{car2=”Chevrolet”}
else if (document.forms[0].elements.car_preference[0].checked)
{car3=”Dodge”}
else if (document.forms[0].elements.car_preference[0].checked)
{car4=”Ford”}
else if (document.forms[0].elements.car_preference[0].checked)
{car5=”Mercedes”}
else if (document.forms[0].elements.car_preference[0].checked)
{car6=”Toyota”}
else if (document.forms[0].elements.car_preference[0].checked)
{car7=”BMW”}
}
</script>
</head>

<body text="#000080" vlink="#000080" background="graphics/background2.gif" link="#000080">
<center><big>Sample Select A</big></center>

           
<cfform name="example_input_b" method="post" datasource="#d_oracle#" username="#u_oracle#" password="#p_oracle#" DEBUG>
<center>
What make of automobile is of interest to you? <small>check all that you like</small><br>
<cfinput type="checkbox" name="car_preference1">Audi <br>
<cfinput type="checkbox" name="car_preference2">Chevrolet <br>
<cfinput type="checkbox" name="car_preference3">Dodge <br>
<cfinput type="checkbox" name="car_preference4">Ford <br>
<cfinput type="checkbox" name="car_preference5">Mercedes <br>
<cfinput type="checkbox" name="car_preference6">Toyota <br>
<cfinput type="checkbox" name="car_preference7">BMW
</center>
<p align=right>
<input name="submit" type="submit" value="Start the Search!" OnClick="define_option(); return false;">
</cfform>

            <cfquery name="possible_cars" datasource="#d_oracle#" username="#u_oracle#" password="#p_oracle#" DEBUG>
SELECT model FROM new_cars WHERE model=’#car1#’ OR ’#car2#’ OR ’#car3#’ OR ’#car4#’
OR ’#car5#’ OR ’#car6#’ OR ’#car7#’
</cfquery>

<ul>
<cfoutput query="possible_cars">
<li>#model#</li>
</cfoutput>
</ul>

<small>
<script language="JavaScript">
// This automatically updates the last modified date for the page.
//
when = document.lastModified
document.write("This page was last modified on: " + when + "<br>")
//
// This automatically updates the location documentation on the page.
where = document.location
document.write("URL: " + where)
</script>

</body>
</html>

<!DOCTYPE HTML PUBLIC "-     //W3C     //DTD HTML 4.0 Transitional     //EN"><html><head>
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<title>JavaScript Examples</title>
<style type="text/css">
<!--
     H1, H2, H3, H4, H5, H6 {font-family:"Arial"}
     td {font-family:"Arial"}
     td {font--size: 10pt}
     td {font-weight: bold}
     td {border-width: 2px}
     table {border-color: #8D89C7}
     body {font-family:"Arial"; font-size: 10pt; font-weight:bold}
     p {font-family:"Arial"; font-size: 10pt; font-weight:bold}
-->
</style>
<script>
            function CheckLease();
                   {   
                        if (Form.tenure.value  == “1-4years”)
                           {
                           //the window.blur command takes the user's attention from the current screen
                           //this will have the effect of moving the user's attention to the new window that
                           //is being opened
                                    window.blur()
myWindow = window.open ("inquire_lease.html","new_question"," location=no,toolbar=no,directories=no,menubar=no,status=no,scrollbars=no,focus=yes,
                                    height=400,width=175,top=50, left=400 ")
                           }
                   }                                       
</script>
</head>
<body text="#000080" vlink="#000080" background="graphics/background2.gif" link="#000080">
<center><big>Window Open</big></center>
           
<cfform name="example_input_a" method="post" datasource="#d_oracle#" username="#u_oracle#" password="#p_oracle#" DEBUG>
                        <center>
                                    How long do you expect to keep this vehicle?<br>
                                                <cfinput type="radio" name="tenure" value="1-4years">1-4 years<br>
                                                <cfinput type="radio" name="tenure" value="morethan4years">more than 4 years<p>                               Do you prefer a new vehicle?<br>
                                                <cfinput type="radio" name="newcarflag" value="yes"
                                                            OnClick=”CheckLease();  return false;>Yes<br>
                                                <cfinput type="radio" name="newcarflag" value="no">No<br>
                                                <cfinput type="radio" name="newcarflag" value="idontknow">I don’t know<br>
                        </center>
                        <p align=right>
                                    <input name="submit" type="submit" value="Start the Search!">

            </cfform>

<small>
<script language="JavaScript">
// This automatically updates the last modified date for the page.
//
when = document.lastModified
document.write("This page was last modified on: " + when + "<br>")
//
// This automatically updates the location documentation on the page.
where = document.location
document.write("URL: " + where)
</script>
</body></html>

 

   Page Owner: Professor Sauter (Vicki.Sauter AT umsl.edu)