javascript : trouble passing value to alert from hidden tag or text
<p>I have an html file which passes values into a java servlet to insert into the database.  Here is my code: </p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript"&gt;
function masinsert(id)
{
 var currentTime=new Date();


 var button = document.getElementById("m"+id);
 button.onclick="";
 button.value="Inserting";

 var partnumber     = document.getElementById("partnumber"+id).value;
 var itemcost    = document.getElementById("itemcost"+id).value;
 var itemlistprice  = document.getElementById("itemlistprice"+id).value;
 var sUnitMeasKey   = document.getElementById("UnitMeasKey"+id);
 var sPurchProdLine     = document.getElementById("PurchProdLine"+id);
 var sItemClassKey  = document.getElementById("itemclasskey"+id);

 var UMKselected = getSelected(sUnitMeasKey);
 var PPLselected = getSelected(sPurchProdLine);
 var ICKselected = getSelected(sItemClassKey);

 function handleHttpResponse()
  {
   if (http.readyState == 4) {
    button.value="Imported";
   }
  }


 var http = getHTTPObject(); // We create the HTTP Object
 var tempUrl = "\MASInsert2";
 tempUrl +=  "?partnumber="+partnumber+"&amp;"+"itemcost="+itemcost+"&amp;"+"itemlistprice="+itemlistprice+"&amp;"+"UnitMeasure="+UMKselected+"&amp;"+"PurchProdLine="+PPLselected+"&amp;"+"itemclasskey="+ICKselected;
  alert(tempUrl);
 http.open("POST", tempUrl, true);
 http.onreadystatechange = handleHttpResponse;
 http.send(null);   
}


function getSelected(ele)
{
    return ele.options[ele.selectedIndex].value;
}

function getHTTPObject(){
 var xmlhttp;
 /*@cc_on
 @if (@_jscript_version &gt;= 5)
   try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
   }catch (e){
    try {
     xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
     }catch (E) {
      xmlhttp = false;
      }
  }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp &amp;&amp; typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
 }
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;form name=bob method=get&gt;
&lt;input type=hidden id="partnumber321" name="partnumber321" value="884910U"&gt;
&lt;input type=hidden id="itemcost321" name="itemcost321" value="1027.39"&gt;
&lt;input type=hidden id="itemlistprice321" name="itemlistprice321" value="1129.0"&gt;
&lt;input type=hidden id="itemdescription321" name="itemdescription321" value="XSERIES 306M SS P4 3.0GHZ 1MB"&gt;
&lt;select id="UnitMeasKey321" name="UnitMeasKey321"&gt;&lt;option value="112"&gt;Each&lt;/select&gt;
&lt;select id="PurchProdLine321" name="PurchProdLine321"&gt;&lt;option value="18"&gt;IBM&lt;/select&gt;
&lt;select id="itemclasskey321" name="itemclasskey321"&gt;&lt;option value="48"&gt;Hardware&lt;/select&gt;
&lt;input id="m321" type="button" onclick="masinsert('321')" value="Add"&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>When I hit the button, the alert(partnumber) returns null (firefox) or object (IE). Am I passing these values incorrectly for the servlet to process? Any ideas why?  shouldn't it return a value?  </p>

<p>thanks in advance</p>
