Jump menu

I have this form below, what i am trying to accomplish here is fill all these fields, and when i choose one of the it should take me to the right file, i was able to do that but i couldn't submit anything to the database, so what is the right way


<cfparam name="customer" default="">
<!--- Create it by Ashraf Samuel for the testing department Autoliv Auburn Hills, MI

      Database associate it withe this is Test_info table SQL
 --->
<cfparam name="SESSION.auth.userID" default="1">
<cfquery name="UserInfo" datasource="testrequest">
SELECT userID, user_name, Phone_No FROM dbo.Requester_info WHERE userID = #SESSION.auth.userID#

</cfquery>
<cfquery name="customerinfo" datasource="testrequest">
SELECT custID, customerName FROM dbo.customerInfo
</cfquery>
<html>
<head>
<title>Test Information Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--- <Script Language="javascript" Type = "text/javascript">
      function jump(list) { location.href = list.options[list.selectedIndex].value} ---></Script>
<style type="text/css">
<!--
.test {
      font-family: "Times New Roman", Times, serif;
      font-size: medium;
      font-style: normal;
      line-height: normal;
      font-weight: bold;
      font-variant: normal;
      color: #000066;
}
-->
</style>
</head>
<body>
<cfform action="MembersOnly_action.cfm" method="post" target="blank" name="members">
  <input type="hidden" name="IsValidUser" value="1">
  <table width="753" height="358" border="0" align="center" cellpadding="5" cellspacing="15" bordercolor="#990033" bgcolor="#00FFFF">
    <tr>
      <th colspan="2"> <font size="+1">Test General Information</font> </th>
    </tr>
    <tr>
      <td width="367" class="test"> Today's Date: </td>
      <td width="321"> <cfset today =dateformat(now(),"mm/dd/yyyy")> <cfoutput>
          <cfinput name="today_date" type="text" value="#today#">
        </cfoutput> </td>
    </tr>
    <td class="test"></tr>
    <tr>
      <td class="test"> Requester name: </td>
      <td> <cfoutput>
          <cfinput name="user_name" type="text" value="#session.auth.user_name#" readonly="true" required="no">
        </cfoutput> </td>
    </tr>
    <tr>
      <td height="26" class="test"> Customer name: </td>
      <td> <select name="customer" id="customer">
          <cfoutput query="customerinfo">
            <option value="#customerinfo.custID#">#customerinfo.customerName#</option>
          </cfoutput> </select> <a href="../Work_request/Customer_Info/customerSignIn.cfm">Add
        New Customer</a> </td>
    </tr>
    <tr>
      <td class="test"> Billing Information: </td>
      <td> <select name="billing_info" id="billing_info">
          <option value="Internal">Internal</option>
          <option value="External">External</option>
          <option value="external billable">External Billable</option>
        </select> </td>
    </tr>
    <tr>
      <td class="test"> What type of test you will run?</td>
      <td> <select name="test_type" size="1" id="test_type">
          <option value="members_only.cfm" selected>Choose test type</option>
          <option value="NewHygeWizard.cfm">Hyge- Rigid Sled Buck test </option>
          <option value="newCOPWizard.cfm">Component belt- COP test</option>
          <option value="NewSoftBodyWizard.cfm">Hyge- Soft Body test</option>
          <option value="NewBarrierWizard.cfm">Barrier test</option>
          <option value="NewDropTowerWizard.cfm">Drop Tower</option>
          <option value="NewImpactWizard.cfm">Impact test</option>
          <option value="NewComponentWizard.cfm">LEV_LVC_QA test</option>
          <option value="NewOOPWizard.cfm">OOP test</option>
          <option value="NewSeatBeltWizard.cfm">Seat Belt test</option>
          <option value="NewHygeSideImpact.cfm">Hyge Side Impact</option>
        </select>
        <!--- <input name="Go" type="button" onChange="FormAction(this.value);" value="Go"> --->
      </td>
    </tr>
    <tr>
      <td class="test">How many tests are you looking to run?</td>
      <td><cfinput name="testNo" type="text" id="testNo" size="3" maxlength="3"></td>
    </tr>
    <tr>
      <td class="test"> Archive Life: </td>
      <td><select name="archive" id="archive">
          <option>Choose the Archiving Type</option>
          <option value="Development test 4Yrs">Development test (4 Yrs)</option>
          <option value="DV/PV/Cert (23 Yrs)">DV/PV/Cert (23 Yrs)</option>
        </select> </td>
    </tr>
    <tr>
      <td class="test">What is your Target Test Date after all the parts kitted?</td>
      <td> <cfinput name="target_date"
           type="text"
              maxlength="20" required="no"
               validate="date"> </td>
    </tr>
    <tr>
      <td class="test">What is the Test Objective: </td>
      <td> <textarea name="test_obj" rows="3" wrap="VIRTUAL" id="test_obj"></textarea>
      </td>
    </tr>
    <tr>
      <td colspan="2" align="center" > </tr>
    <tr>
      <td colspan="2"> <div align="center">
          <!--- <input name="GO" type="button" onClick="javascript:jump(document.members.test_type)" value="GO"> --->
          <input name="Submit" type="submit" value="Submit">
          <input name="Cancel" type="reset" value="Cancel">
          <input name="Close Browser" type="button" id="Close Browser" onClick="javescript: window.close()" value="Close Browser">
        </div></td>
    </tr>
  </table>
 
</cfform>
</body>
</html>
asamuelAsked:
Who is Participating?
 
anandkpConnect With a Mentor Commented:
u need something like this :

<form name="x" action"sompage.cfm" method="post">
 .
.
.
.

<select onChange="document.x.submit()" name="sel1">
 <option> ....
  ....
</select>

</form>

is this what ur looking for

K'Rgds
Anand
0
 
anandkpCommented:
<FORM NAME="frm" ACTION "sompage.cfm" METHOD="post">      .
      .
      .
      .
      <SELECT onChange="subMe()" NAME="sel1">
            <OPTION value="url1.cfm">url1</option>....
            <OPTION value="url2.cfm">url2</option>....
            <OPTION value="url3.cfm">url3</option>....
      </SELECT>
</FORM>

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function subMe()
{
      document.frm.action = document.frm.sel1.selectedIndex;
      document.frm.submit();
}
//-->
</SCRIPT>
0
 
anandkpCommented:
<FORM NAME="frm" ACTION "sompage.cfm" METHOD="post">      .
      .
      .
      .
      <SELECT onChange="subMe()" NAME="sel1">
            <OPTION value="url1.cfm">url1</option>....
            <OPTION value="url2.cfm">url2</option>....
            <OPTION value="url3.cfm">url3</option>....
      </SELECT>
</FORM>

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function subMe()
{
      document.frm.action = document.frm.sel1[document.frm.sel1.selectedIndex].value;
      document.frm.submit();
}
//-->
</SCRIPT>
0
 
anandkpCommented:
change that to ...

document.frm.action = document.frm.sel1.options[document.frm.sel1.selectedIndex].value;

hth

K'Rgds
Anand
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.