Solved

Jump menu

Posted on 2004-04-08
7
294 Views
Last Modified: 2013-12-24
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>
0
Comment
Question by:asamuel
  • 4
7 Comments
 
LVL 17

Accepted Solution

by:
anandkp earned 500 total points
ID: 10789925
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
 
LVL 17

Expert Comment

by:anandkp
ID: 10789941
<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
 
LVL 17

Expert Comment

by:anandkp
ID: 10789943
<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
 
LVL 17

Expert Comment

by:anandkp
ID: 10795829
change that to ...

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

hth

K'Rgds
Anand
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now