
September 12th, 2006, 11:14 AM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 5
Time spent in forums: 1 h 51 m 11 sec
Reputation Power: 0
|
|
|
javascript assistance
Mittineague, thanks for the input. The problem I am having is getting javascript to put ANY values after the ?. Actually, if it would put a '?' I would feel like I am making headway. Here is a cut-n-paste example of the code I am trying to run.
Code:
<html>
<head>
<script type="text/javascript">
function UpdateVendor(SupplierID, PO, LineNo, DateRec, TimeRec)
{
if(confirm("Are you sure you want to change the supplier?")){
//display the data that should be included
alert ("SupplierID = " + SupplierID + "\nPO = " + PO + "\nLineNo = " + LineNo + "\nDateRec = " + DateRec + "\nTimeRec = "
+ TimeRec);
var mylink = "test2.html?SupplierID=" + SupplierID + "&PO=" + PO + "&LineNo=" + LineNo + "&DateRec=" + DateRec +
"&TimeRec=" + TimeRec;
location.href = mylink;
//location.href = location.href + "?" + "SupplierID=" + SupplierID + "&PO=" + PO + "&LineNo=" + LineNo + "&DateRec=" +
DateRec + "&TimeRec=" + TimeRec;
}
}
</script>
</head>
<body>
<table>
<tr>
<td>PO</td>
<td>Line No</td>
<td>Date Rec</td>
<td>Time Rec</td>
<td>Vendor</td>
</tr>
<tr><form name=myform>
<td><input name = "PO" type="text" value="12345"></td>
<td><input name = "LineNo" type="text" value="1"></td>
<td><input name = "DateRec" type="text" value="08/11/2006"></td>
<td><input name = "TimeRec" type="text" value="12:45 PM"></td>
<td>
<select Name = "SupplierID" ONCHANGE="UpdateVendor(myform.SupplierID.options[selectedIndex].value,
myform.PO.value, myform.LineNo.value, myform.DateRec.value, myform.TimeRec.value)">
<option value="1">Company 1</option>
<option value="2">Company 2</option>
<option value="3">Company 3</option>
<option value="4">Company 4</option>
</select>
</td></form>
</tr>
<tr><form name=myform2>
<td><input name = "PO" type="text" value="22222"></td>
<td><input name = "LineNo" type="text" value="21"></td>
<td><input name = "DateRec" type="text" value="08/21/2006"></td>
<td><input name = "TimeRec" type="text" value="2:30 PM"></td>
<td>
<select Name = "SupplierID" ONCHANGE="UpdateVendor(myform2.SupplierID.options[selectedIndex].value,
myform2.PO.value, myform2.LineNo.value, myform2.DateRec.value, myform2.TimeRec.value)">
<option value="1">Company 1</option>
<option value="2">Company 2</option>
<option value="3">Company 3</option>
<option value="4">Company 4</option>
</select>
</td></form>
</tr>
</body>
</html>
So, my initial problem is as it stands, I am having difficulty finding a way to pass variables to a PHP script using javascript.
|