Notice: Undefined index: Scales ...but it is defined? :S

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ChrisPintys
    New Member
    • Aug 2010
    • 20

    Notice: Undefined index: Scales ...but it is defined? :S

    Hey,

    I'm thinking this is something simple, as I'm a PHP/Web Dev newb, been asked to develop an app for work, so I'm stumbling my way through this, any how, I get the error:

    Notice: Undefined index: Scales in C:\wamp\www\TS\ upload.php on line 31

    Here is a bit of the code that declares it:

    Code:
    <p></p></div>
          <p>&nbsp;</p>
          <p>&nbsp;&nbsp;&nbsp; <strong>Scales:</strong></p>
          <p>&nbsp;&nbsp; &nbsp;<textarea rows="6" cols="50" name="Scales"></textarea>&nbsp;</p>
          <p>&nbsp;&nbsp; &nbsp;<strong>Comments:</strong></p>
          <p>&nbsp;&nbsp; &nbsp;<textarea rows="6" cols="50" name="Comments"></textarea>&nbsp;</p>
          <p>&nbsp;&nbsp;

    And the code in the upload.php file that calls it trying to upload it to the DB:

    Calling it into a variable:
    Code:
    $Scales =  $_POST["Scales"];
    Uploading to DB:

    Code:
    if ( !( $database = odbc_connect( "tradespend", "chrisbwamp","")))
    die( "Could not connect to database" );
    
    $headerSQL = odbc_prepare($database, "INSERT INTO WebForm (Action,WebID,StartDate,EndDate,RequestType,TSH1,TSH2,TSH3,TSH4,SoldTo,CustomerType,EndUserNames,Scales,Comments,Status,EnteredBy)
    VALUES('$action','$WebID','$sdate','$edate','$RequestType','$TSH1','$TSH2','$TSH3','$TSH4','$SoldTo','$CustomerType','$EndUserNames','$Scales','$Comments','$Status','$EnteredBy');" ); 
    
    if (!odbc_execute( $headerSQL))
    {
    /* error */
    echo "<h1>Insert of Header data has failed! Please contact IThelpdesk@pintys.com and reference Chris Beach</h1>";
    //break;
    }
    I have a bunch of fields working this way, most work, and about 4 of them are giving the same error as above.

    Any ideas?
  • zorgi
    Recognized Expert Contributor
    • Mar 2008
    • 431

    #2
    Can you give us more of the code from your form? I guess first part of your pasted code is the form. It sounds as if things are not getting posted properly.

    Comment

    • ChrisPintys
      New Member
      • Aug 2010
      • 20

      #3
      I warn you, it is not pretty, but thank you very much for replying!

      Code:
      <?php
      session_start();  
      if(isset($_SESSION['loggedin']))
      {
        if(($_SESSION['loggedin']) == 'true')
      {
          // echo 'yes true';
      }
           else
      header("location:login.php");
      // echo 'no not true';
      }
      else
      header("location:login.php");
      // echo 'no';
      ?>
       
      
      
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
      <html><head><title>Trade Spend Request Form</title>
      <meta name="GENERATOR" content="MSHTML 8.00.6001.18928">
      <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
      <script>
      function getXMLHTTP() { //fuction to return the xml http object
      		var xmlhttp=false;	
      		try{
      			xmlhttp=new XMLHttpRequest();
      		}
      		catch(e)	{		
      			try{			
      				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
      			}
      			catch(e){
      				try{
      				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
      				}
      				catch(e1){
      					xmlhttp=false;
      				}
      			}
      		}
      		 	
      		return xmlhttp;
      	}
      		              
      	
      	function getCity($elementID,strURL) {		
      		
      		var req = getXMLHTTP();
      		
      		if (req) {
      			
      			req.onreadystatechange = function() {
      				if (req.readyState == 4) {
      					// only if "OK"
      					if (req.status == 200) {						
      						document.getElementById($elementID).innerHTML=req.responseText;						
      					} else {
      						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
      					}
      				}				
      			}			
      			req.open("GET", strURL, true);
      			req.send(null);
      		}
      				
      	}
      </script>
      <script language="javascript"> 
      function toggle() {
      	var ele = document.getElementById("hiddenConditions");
      	var text = document.getElementById("displayText");
      	if(ele.style.display == "block") {
          		ele.style.display = "none";
      		text.innerHTML = "More";
        	}
      	else {
      		ele.style.display = "block";
      		text.innerHTML = "hide";
      	}
      } 
      </script>
      
      <script language="javascript" type="text/javascript" src="datetimepicker.js"> 
      </script>
      
      
      <?php 
      
        //Function to Connect to Daisy, execute Sql SELECT statement, and convert results to an array as a return value
      function sqlSelect($daisySelect)
      {
        //connect to a DSN, "daisy" 
      $conn = odbc_connect('daisy','chrisbwamp',''); 
      if ($conn) 
      { 
        //The SQL statement that will query the database 
        $query = $daisySelect; 
      
        //Perform the query 
        $result=odbc_exec($conn, $query); 
      
        //Convert results to an array
        while(odbc_fetch_row($result))
        { 
           for($i=1;$i<=odbc_num_fields($result);$i++)  
                {
                   $selectArray[]=odbc_result($result,$i);
                }
        } 
      return $selectArray;
      }
       else echo "ODBC not connected, please contact ITHelpdesk@pintys.com";  
      }
      
      ?>
      <style>
      <!--
      h1 { font-family: Arial, sans-serif; font-size: 30px; }
      h2 { font-family: Arial, sans-serif; font-size: 18px; }
      
      body,p,b,i,em,dt,dd,dl,sl,caption,th,td,tr,u,blink,select,option,form,div,li { font-family: Arial, sans-serif; font-size: 12px; }
      
      
      /* IE Specific */
      body, textarea {
        scrollbar-3dlight-color: #DDDED6;
        scrollbar-highlight-color: #FDE7A2;
        scrollbar-face-color: #FABD05;
        scrollbar-shadow-color: #CA9904;
        scrollbar-darkshadow-color: #805B32;
        scrollbar-arrow-color: #000000;
        scrollbar-track-color: #F8EFE2;
      }
      /* END IE Specific */
      
      
      a.mainlink:link { text-decoration: none; color: #ffffff; font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; }
      a.mainlink:visited { text-decoration: none; color: #ffffff; font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; }
      a.mainlink:hover { text-decoration: underline; color: #ffffff; font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; }
      -->
      
      </style>
      
      </head>
      <body bgcolor="#ffffff">
      <p>
      <table border="0" cellspacing="1" cellpadding="3" width="780" bgcolor="#fabd05" 
      align=center>
        <tbody>
        <tr>
          <td bgcolor="#fabd05">
            <p align="center"><br><strong>&nbsp;<font size="7">Trade Spend Request 
            </font></strong></p></td></tr>
        <tr>
          <td bgcolor="#fabd05">
            <p align="center"><font 
        color=#fabd05><strong></strong></font>&nbsp;</p></td></tr>
        <tr>
          <td bgcolor="#ffffff">
            <form method="post" name="tradespend" 
            action="upload.php">
            <p>&nbsp;</p>
            <fieldset 
            style="Z-INDEX: 0; WIDTH: 360px; HEIGHT: 75px; LEFT: 146px"><legend>Web 
            Form:</legend>
            <p>&nbsp;&nbsp;&nbsp;&nbsp;<strong>Action:</strong> <select 
            style="Z-INDEX: 0; TOP: 237px; LEFT: 209px" size=1 name=Action><option 
              selected value=Create>Create</option> <option value="Edit">Edit</option> 
              <option value="Display">Display</option> <option 
              value=Delete>Delete</option> 
            &lt;\SELECT&gt;</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Web 
            ID:</strong> <input style="Z-INDEX: 0; TOP: 236px; LEFT: 360px" 
            name=WebID></p></fieldset> 
            <p>&nbsp;&nbsp;&nbsp;<strong>Start Date:</strong>&nbsp;&nbsp;&nbsp; <input 
            style="WIDTH: 78px; HEIGHT: 22px" id=sdate size=10 name=sdate><a 
            href="javascript:NewCal('sdate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> 
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>End Date:&nbsp; 
            </strong>&nbsp;<input style="WIDTH: 78px; HEIGHT: 22px" id="edate" size="10" 
            name=edate><a href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a></p>
            <p><strong>&nbsp;&nbsp;&nbsp; Request Type:</strong> <select size="1" 
            name=RequestType><option selected value=New>New</option> <option 
              value=Incremental/Change>Incremental/Change</option> 
            &lt;\SELECT&gt;</select>&nbsp;&nbsp;&nbsp;&nbsp;</p>
            <p>&nbsp;&nbsp;&nbsp; </p>
            <p><strong>&nbsp;&nbsp;&nbsp;&nbsp;Trade Spend Hierarchy:</strong> </p>
            <p>&nbsp;&nbsp;&nbsp;&nbsp;<select size="1" name="TSH1"><option selected 
              value=test>test</option> &lt;\SELECT&gt;</select>&nbsp;&nbsp; <select 
            size=1 name=TSH2><option selected value=test>test</option> 
            &lt;\SELECT&gt;</select>&nbsp;&nbsp;<select size="1" name="TSH3"><option 
              selected value=test>test</option> 
            &lt;\SELECT&gt;</select>&nbsp;&nbsp;<select size="1" name="TSH4"><option 
              selected value=test>test</option> &lt;\SELECT&gt;</select></p>
            <p>&nbsp; &nbsp; <strong>Sold-to:</strong> <select size="1" 
              name=SoldTo><option selected value=10000>10000</option> 
            &lt;\SELECT&gt;</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Customer 
            Type:</strong> <select size="1" name="CustomerType"><option selected 
              value=Deleted>Deleted</option> <option value="Food Service">Food 
              Service</option> <option value="Industrial">Industrial</option> <option 
              value=Intercompany>Intercompany</option> <option 
              value=Retail>Retail</option> &lt;\SELECT&gt;</select></p>
            <p>&nbsp;&nbsp; &nbsp;<strong>End User Name(s):</strong></p>
            <p>&nbsp; &nbsp; 
            <textarea rows="6" cols="50" name="EndUserNames"></textarea>&nbsp;</p>
            <p>&nbsp;&nbsp; &nbsp;<strong><font color="#454453" size="3" 
            face=Verdana>Condition Records:</font></strong></p>
            <hr>
      
            <p>&nbsp;&nbsp;&nbsp;&nbsp;<strong><em>Item 
            Type</em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            <em>Material 
            Number</em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>Forecasted&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            UOM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Discount&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            Unit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            Program&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            End 
            Date<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            Volume&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rate</em></strong></p>
            <div id="div1">&nbsp;&nbsp; 
           
            
            
            <select size="1" name="itemType1" onChange="getCity('material1','findcity.php?itemType='+this.value)"><option selected 
              value=""></option> <option value="Material">Material</option><option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select>           
             <span id="material1">
      <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name="city1" id="city1">
       </select>    </span>           
      <input style="WIDTH: 69px; HEIGHT: 22px" size="6" 
            name=ForecastedVollume1><select size="1" name="UOM1"><option 
              value=></option> <option value="Carton">Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="4" 
            name=DiscountRate1><select size="1" name="Unit1"><option value=""></option> <option 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select style="width: 110px;" size="1" name="Program1"><option selected 
              value=></option> <option 
              value=1>Conditions: Price</option> <option 
              value=2>Extra Charge</option> <option 
              value=3>ZCS	Case/KG/%Discount</option> <option 
              value=4>Fees (Lump Sum)</option> 
              <option value=5>Special Promotion</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="sdate1" 
            size=10 name=sdate1><a href="javascript:NewCal('sdate1','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate1 size=10 name=edate1><a 
            href="javascript:NewCal('edate1','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            
            
                  <select size="1" name="itemType2" onChange="getCity('material2','findcity.php?itemType='+this.value)"><option selected 
              value=""></option> <option value="Material">Material</option><option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select>    
             
             <span id="material2">
      <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name="city2" id="city2">
       </select>    </span>
                 
      <input style="WIDTH: 69px; HEIGHT: 22px" size="6" 
            name=ForecastedVollume2><select size="1" name="UOM2"><option 
              value=></option> <option value="Carton">Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="4" 
            name=DiscountRate2><select size="1" name="Unit2"><option value=""></option> <option 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select style="width: 110px;" size="1" name="Program2"><option selected 
              value=></option> <option 
              value=1>Conditions: Price</option> <option 
              value=2>Extra Charge</option> <option 
              value=3>ZCS	Case/KG/%Discount</option> <option 
              value=4>Fees (Lump Sum)</option> 
              <option value=5>Special Promotion</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="sdate2" 
            size=10 name=sdate2><a href="javascript:NewCal('sdate2','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate2 size=10 name=edate2><a 
            href="javascript:NewCal('edate2','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            
            
             <select size="1" name="itemType3" onChange="getCity('material3','findcity.php?itemType='+this.value)"><option selected 
              value=""></option> <option value="Material">Material</option><option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select>    
             
             <span id="material3">
      <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name="city3" id="city3">
       </select>    </span>
                 
      <input style="WIDTH: 69px; HEIGHT: 22px" size="6" 
            name=ForecastedVollume3><select size="1" name="UOM3"><option 
              value=></option> <option value="Carton">Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="4" 
            name=DiscountRate3><select size="1" name="Unit3"><option value=""></option> <option 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select style="width: 110px;" size="1" name="Program3"><option selected 
              value=></option> <option 
              value=1>Conditions: Price</option> <option 
              value=2>Extra Charge</option> <option 
              value=3>ZCS	Case/KG/%Discount</option> <option 
              value=4>Fees (Lump Sum)</option> 
              <option value=5>Special Promotion</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="sdate3" 
            size=10 name=sdate3><a href="javascript:NewCal('sdate3','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate3 size=10 name=edate3><a 
            href="javascript:NewCal('edate3','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            
            
            
            
            <select size="1" name="ItemType">
            <option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><?php
      $arrProductNum=sqlSelect("SELECT Material_ID + ' - ' + DESCRIPTION AS Expr1
      FROM VW_TradeSpend_Material ORDER BY Material_ID ASC");
      ?>
      <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name=MaterialNumber> 
      <?php
      foreach($arrProductNum as $products) { 
            echo'<option value="'.$products.'">'.ltrim($products,"0").'</option>'; } 
            echo "</select>"; 
      ?> <input style="WIDTH: 69px; HEIGHT: 22px" size="6" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="5" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            
            
            
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><?php
      $arrProductNum=sqlSelect("SELECT Material_ID + ' - ' + DESCRIPTION AS Expr1
      FROM VW_TradeSpend_Material ORDER BY Material_ID ASC");
      ?>
      <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name=MaterialNumber> 
      <?php
      foreach($arrProductNum as $products) { 
            echo'<option value="'.$products.'">'.ltrim($products,"0").'</option>'; } 
            echo "</select>"; 
      ?> <input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> </div>&nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp; 
            &nbsp;<select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> 
            <div></div>
            <div id="div2">&nbsp;&nbsp; <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> </div>&nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp; 
            &nbsp;<select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> 
            <p></p>
            <div></div><a id="displayText" href="javascript:toggle();">More</a> 
            <div style="DISPLAY: none" id="hiddenConditions">&nbsp;&nbsp; <select size="1" 
            name=ItemType><option selected value=Material>Material</option> <option 
              value=PH1>PH1</option> <option value="PH2">PH2</option> <option 
              value=PH3>PH3</option> <option value="PH4">PH4</option> 
            &lt;\SELECT&gt;</select><select size="1" name="MaterialNumber"><option 
              selected value="10000 - Chicken Fingers">10000 - Chicken 
              Fingers</option> &lt;\SELECT&gt;</select><input 
            style="WIDTH: 69px; HEIGHT: 22px" size=7 name=ForecastedVollume><select 
            size=1 name=UOM><option selected value=Carton>Carton</option> <option 
              value=KG>KG</option> &lt;\SELECT&gt;</select><input 
            style="WIDTH: 54px; HEIGHT: 22px" size=6 name=DiscountRate><select size="1" 
            name=Unit><option selected value=Percent>Percent</option> <option 
              value=KG>KG</option> <option value="Carton">Carton</option> <option 
              value="Lump $">Lump $</option> &lt;\SELECT&gt;</select><select size="1" 
            name=Program><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp; 
            &nbsp;<select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> &nbsp;&nbsp; 
            <select size="1" name="ItemType"><option selected 
              value=Material>Material</option> <option value="PH1">PH1</option> <option 
              value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
              value=PH4>PH4</option> &lt;\SELECT&gt;</select><select size="1" 
            name=MaterialNumber><option selected 
              value="10000 - Chicken Fingers">10000 - Chicken Fingers</option> 
              &lt;\SELECT&gt;</select><input style="WIDTH: 69px; HEIGHT: 22px" size="7" 
            name=ForecastedVollume><select size="1" name="UOM"><option selected 
              value=Carton>Carton</option> <option value="KG">KG</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 54px; HEIGHT: 22px" size="6" 
            name=DiscountRate><select size="1" name="Unit"><option selected 
              value=Percent>Percent</option> <option value="KG">KG</option> <option 
              value=Carton>Carton</option> <option value="Lump $">Lump $</option> 
              &lt;\SELECT&gt;</select><select size="1" name="Program"><option selected 
              value=Classifications>Classifications</option> <option 
              value=Go>Go</option> <option value="Here">Here</option> 
            &lt;\SELECT&gt;</select><input style="WIDTH: 78px; HEIGHT: 22px" id="edate" 
            size=10 name=sdate><a href="javascript:NewCal('edate','ddmmyyyy')"><img 
            border=0 alt="Pick a date" src="cal.gif" width=16 height=16></a><input 
            style="WIDTH: 78px; HEIGHT: 22px" id=edate size=10 name=sdate><a 
            href="javascript:NewCal('edate','ddmmyyyy')"><img border="0" 
            alt="Pick a date" src="cal.gif" width=16 height=16></a> 
            <p></p></div>
            <p>&nbsp;</p>
            <p>&nbsp;&nbsp;&nbsp; <strong>Scales:</strong></p>
            <p>&nbsp;&nbsp; &nbsp;<textarea rows="6" cols="50" name="Scales"></textarea>&nbsp;</p>
            <p>&nbsp;&nbsp; &nbsp;<strong>Comments:</strong></p>
            <p>&nbsp;&nbsp; &nbsp;<textarea rows="6" cols="50" name="Comments"></textarea>&nbsp;</p>
            <p>&nbsp;&nbsp; 
            &nbsp;<strong>Status:</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            &nbsp;<input name="Status"></p>
            <p>&nbsp;&nbsp;&nbsp; <strong>Entered By: </strong> <input 
            name=EnteredBy value="<?php print $_SESSION['loggedinName'];?>"/></p>
            <p>&nbsp;</p>
            <p>&nbsp;</p>
            <p>&nbsp;</p>
      
       <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      <input value="Submit" type="submit" name="submit"><input value="Reset" type="reset" name="reset"> 
            </form></p></td></tr>
        <tr>
          <td bgcolor="#ffffff">&nbsp;</td></tr></tbody></table></ P></p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p><font size="1"><font size="1"></font></a></p></font></font></body></html>

      And My Upload.php:

      Code:
      <?php
      //error_reporting(E_ALL ^ E_NOTICE);  
      //condition record variables
      
      $sdates = array($_POST["sdate1"],$_POST["sdate2"],$_POST["sdate3"]);
      $edates = array($_POST["edate1"],$_POST["edate2"],$_POST["edate3"]);
      $itemTypes = array($_POST["itemType1"],$_POST["itemType2"],$_POST["itemType3"]);
      $citys = array($_POST["city"],$_POST["city2"],$_POST["city3"]);
      $ForecastedVolumes = array($_POST["ForecastedVollume1"],$_POST["ForecastedVollume2"],$_POST["ForecastedVollume3"]);
      $UOMS = array($_POST["UOM1"],$_POST["UOM2"],$_POST["UOM3"]);
      $DiscountRates = array($_POST["DiscountRate"],$_POST["DiscountRate2"],$_POST["DiscountRate3"]); 
      $Units = array($_POST["Unit1"],$_POST["Unit2"],$_POST["Unit3"]); 
      $Programs = array($_POST["Program1"],$_POST["Program2"],$_POST["Program3"]); 
      
      //web form variables
      
      $action = $_POST["Action"];
      $WebID = $_POST["WebID"];
      $sdate = $_POST["sdate"];
      $edate = $_POST["edate"];
      $RequestType = $_POST["RequestType"];
      $TSH1 = $_POST["TSH1"];
      $TSH2 = $_POST["TSH2"];
      $TSH3 = $_POST["TSH3"];
      $TSH4 = $_POST["TSH4"];
      $SoldTo = $_POST["SoldTo"];
      $CustomerType = $_POST["CustomerType"];
      $EndUserNames = $_POST["EndUserNames"];
      $Status = $_POST["Status"];
      $EnteredBy = $_POST["EnteredBy"];
      $Scales =  $_POST["Scales"];
      $Comments = $_POST["Comments"];
      
      print_r($_POST);
      
      function sqlSelect($daisySelect)
      {
        //connect to a DSN, "daisy" 
      $conn = odbc_connect('daisy','chrisbwamp',''); 
      if ($conn) 
      { 
        //The SQL statement that will query the database 
        $query = $daisySelect; 
      
        //Perform the query 
        $result=odbc_exec($conn, $query); 
      
        //Convert results to an array
        while(odbc_fetch_row($result))
        { 
           for($i=1;$i<=odbc_num_fields($result);$i++)  
                {
                   $selectArray[]=odbc_result($result,$i);
                }
        } 
      return $selectArray;
      }
       else echo "ODBC not connected";  
      }
      
      
      
      
      // connect to ODBC
      if ( !( $database = odbc_connect( "tradespend", "chrisbwamp","")))
      die( "Could not connect to database" );
      
      $headerSQL = odbc_prepare($database, "INSERT INTO WebForm (Action,StartDate,EndDate,RequestType,TSH1,TSH2,TSH3,TSH4,SoldTo,CustomerType,EndUserNames,Scales,Comments,Status,EnteredBy)
      VALUES('$action','$sdate','$edate','$RequestType','$TSH1','$TSH2','$TSH3','$TSH4','$SoldTo','$CustomerType','$EndUserNames','$Scales','$Comments','$Status','$EnteredBy');" ); 
      
      if (!odbc_execute( $headerSQL))
      {
      /* error */
      echo "<h1>Insert of Header data has failed! Please contact IThelpdesk@pintys.com and reference Chris Beach</h1>";
      //break;
      }
      //else echo  "<h1>Header data was successfully uploaded to the database</h1>";
      
      $stmt2=sqlSelect("SELECT MAX(WebID) FROM dbo.WebForm");
      print "the web ID is $stmt2[0]";
      // loop through the itemTypes, if they selected one, then insert that line into the database
      foreach ($itemTypes as $key => $value) {
      if ( $value != "" ) {
      /* run insert */
      print " $key";
      print " $value";
      
      
      $stmt = odbc_prepare($database, "INSERT INTO ConditionRecords (ItemType,Material,ForecastedVolume,UOM,DiscountRate,Unit,Program,StartDate,EndDate,HeaderKey)
      VALUES('$itemTypes[$key]','$citys[$key]','$ForecastedVolumes[$key]','$UOMS[$key]','$DiscountRates[$key]','$Units[$key]','$Programs[$key]','$sdates[$key]','$edates[$key]','1');" );
      
      if (!odbc_execute( $stmt))
      {
      /* error */
      echo "<h1>Upload to database has failed!</h1>";
      //break;
      }
      else echo  "<h1>Trade Spend Request was successfully uploaded to the database</h1>";
      
      }
      }
        
      ?>

      Comment

      • zorgi
        Recognized Expert Contributor
        • Mar 2008
        • 431

        #4
        Woooooooooooow that is not pretty. I ignored it all, copy - pasted your code and submitted the form. It worked. So I guess the problem is somewhere in your upload.php. Can we see more of that code?

        Comment

        • zorgi
          Recognized Expert Contributor
          • Mar 2008
          • 431

          #5
          I have trouble reproducing that error. What are 4 fields giving you that error?

          Comment

          • ChrisPintys
            New Member
            • Aug 2010
            • 20

            #6
            Yeah, sorry for the ugliness :( My first time making a site, I used a form builder to lay everything out, unfortunately it did a messy job of formatting the HTML code.

            These are the fields that fail:


            Notice: Undefined index: city2 in C:\wamp\www\TS\ upload.php on line 8

            Notice: Undefined index: city3 in C:\wamp\www\TS\ upload.php on line 8

            Notice: Undefined index: edate in C:\wamp\www\TS\ upload.php on line 20

            Notice: Undefined index: Scales in C:\wamp\www\TS\ upload.php on line 31

            Notice: Undefined index: Comments in C:\wamp\www\TS\ upload.php on line 32


            ...At least my upload.php is somewhat pretty? :D

            Comment

            • ChrisPintys
              New Member
              • Aug 2010
              • 20

              #7
              Now I'm getting even more confused.

              I changed around the code a bit. On my form, I have rows of drop downs and fields. The first 3 are correct, and getting data from the database, the rest were just place holders until I was sure everything was working.

              Well, I replaced most of the place holders with the code from the first 3 rows of drop downs and input boxes (incrementing variable names with a number), and now when I submit the form, Comments and Scales does not give an undefined index error, and it now contains a value.

              However, I still get:


              Notice: Undefined index: city in C:\wamp\www\TS\ upload.php on line 8

              Notice: Undefined index: city2 in C:\wamp\www\TS\ upload.php on line 8

              Notice: Undefined index: city3 in C:\wamp\www\TS\ upload.php on line 8

              What are the typical reasons it isn't able to populate a variable using $_POST ? Do DIV's or any tags come into effect? I don't get why my city variables just plain don't work.

              Comment

              • zorgi
                Recognized Expert Contributor
                • Mar 2008
                • 431

                #8
                Its very difficult to look through your code. Sometime the best way to do things is to do them from scratch or all over again. All I can see is that your city Select Boxes are probably not getting populated. You should have some sort of default value set for them in your HTML like:

                Code:
                <select name="city">
                    <option value="no city selected">---</option>
                </select>
                or an extra check in your Upload.php. Something like this:

                Code:
                  if(isset($_POST['city'])){
                    $city = $_POST['city'];
                  }else{
                    $city = "no city selected";
                  }

                Comment

                • ChrisPintys
                  New Member
                  • Aug 2010
                  • 20

                  #9
                  Thanks for the reply, I've had some fires at work and couldn't come back until now.

                  It's definitely NOT setting the $_POST variable for the "city" drop downs, I just don't get why, is it possible the <SPAN> is some how preventing this?

                  I basically have a drop down that you select that determines what gets populated in the "city" drop down:
                  Code:
                  <code>
                  
                   <select size="1" name="itemType1" onChange="getCity('material1','findcity.php?itemType='+this.value)"><option selected 
                          value=""></option> <option value="Material">Material</option><option value="PH1">PH1</option> <option 
                          value=PH2>PH2</option> <option value="PH3">PH3</option> <option 
                          value=PH4>PH4</option> &lt;\SELECT&gt;</select>
                  </code>
                  This is the function for it:
                  Code:
                  <code>
                  	function getCity($elementID,strURL) {		
                  		
                  		var req = getXMLHTTP();
                  		
                  		if (req) {
                  			
                  			req.onreadystatechange = function() {
                  				if (req.readyState == 4) {
                  					// only if "OK"
                  					if (req.status == 200) {						
                  						document.getElementById($elementID).innerHTML=req.responseText;						
                  					} else {
                  						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
                  					}
                  				}				
                  			}			
                  			req.open("GET", strURL, true);
                  			req.send(null);
                  		}
                  				
                  	}
                  </code>
                  which then populates the "material1" <span>

                  Like I said, I've been stumbling through all of this, I got it all working, except for getting the value from the city drop down (it does populate).

                  Code:
                  <code>
                   <span id="material1">
                  <select style="width: 158px;" onclick="this.style.width='340px';this.size='10'" onmouseout="this.style.width='158px';this.size=''" class="widthed" name="city1" id="city1">
                   </select>    </span>
                  </code>
                  Last edited by Niheel; Aug 18 '10, 02:26 PM. Reason: added code tags

                  Comment

                  • ChrisPintys
                    New Member
                    • Aug 2010
                    • 20

                    #10
                    I wrote a whole long response, and it stated it had to be approved before it was shown, that was yesterday...wha t gives?

                    Comment

                    • Dormilich
                      Recognized Expert Expert
                      • Aug 2008
                      • 8694

                      #11
                      that’s this forum’s spam filter, it sometimes catches even post, that are not spam.

                      back to the topic, when you load your page for the first time, there are no POST data available, since you didn’t submit the form. you need to check your form data before use as mentioned in post #8.

                      Comment

                      • ChrisPintys
                        New Member
                        • Aug 2010
                        • 20

                        #12
                        Thanks for the reply, and the explanation of the SPAM filter.

                        I think I understand post 8, setting it to a default value if it isn't already set, I just don't understand why mine is not getting set.

                        I set the drop down to a value, and then hit submit to submit the form, all of my other POST variables are set, but this specific one is not, it's also the only one using AJAX...I've spent endless time staring at the code, it's got to be something I don't know about.

                        Comment

                        • JKing
                          Recognized Expert Top Contributor
                          • Jun 2007
                          • 1206

                          #13
                          What does the response text look like?

                          Comment

                          • ChrisPintys
                            New Member
                            • Aug 2010
                            • 20

                            #14
                            Notice: Undefined index: city1 in C:\wamp\www\TS\ upload.php on line 8

                            So city1 is a drop down in my main php page, then when the form is submitted (to upload.php), I try to set a variable to the $_POST["city"] value, but it's not setting (for some reason)

                            Comment

                            • JKing
                              Recognized Expert Top Contributor
                              • Jun 2007
                              • 1206

                              #15
                              Sorry I should have been more specific.

                              Can you copy and paste the html that is produced by the ajax call to populate the drop down.

                              Comment

                              Working...