Hi all,
i have an asp page which includes a combo box.
When a value is selected the onchange event displays another value from the database in a text box below. On this page i also have a submit button. My problem is that i want to be able to submit my form to another page other than this one. This only way i seem to be able to get the onchange event workin is keep the action tag pointing at itself, so it posts itself.
Any help would be greatly appreciated.
thanks
heres part of my code:
<form name="frm" method="post" action="entermat.asp">
<table width="1000" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Part Code </td>
<td><input name="txtPart" type="text" id="txtPart"></td>
<td>Colour</td>
<td><input name="txtColour" type="text" id="txtColour"></td>
</tr>
<tr>
<td>Description</td>
<td><input name="txtDesc" type="text" id="txtDesc"></td>
<td>Coating</td>
<td><input name="txtCoating" type="text" id="txtCoating"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>Hardness</td>
<td><input name="txtHardness" type="text" id="txtHardness"></td>
</tr>
<tr>
<td>Supplier Name</td>
<td><select name="selSupp" id="selSupp" onchange="submit();">
<%
Set oRsSupp=Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT DISTINCT SupplierName FROM tblSupplier ORDER BY SupplierName"
oRsSupp.Open strSQL, ConnString
Response.Write "<OPTION>Please Select...</option>"
Do while not oRsSupp.EOF
if Request.Form("selSupp") = oRsSupp("SupplierName") then 'if this is the selected one then display as selected
Response.Write "<OPTION VALUE = '" & oRsSupp ("SupplierName") & "' SELECTED>"
Response.Write oRsSupp("SupplierName") & "</Option>"
oRsSupp.MoveNext
else
Response.Write "<OPTION VALUE = '" & oRsSupp ("SupplierName") & "'>"
Response.Write oRsSupp("SupplierName") & "</Option>"
oRsSupp.MoveNext
end if
loop
%>
</select>
i have an asp page which includes a combo box.
When a value is selected the onchange event displays another value from the database in a text box below. On this page i also have a submit button. My problem is that i want to be able to submit my form to another page other than this one. This only way i seem to be able to get the onchange event workin is keep the action tag pointing at itself, so it posts itself.
Any help would be greatly appreciated.
thanks
heres part of my code:
<form name="frm" method="post" action="entermat.asp">
<table width="1000" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Part Code </td>
<td><input name="txtPart" type="text" id="txtPart"></td>
<td>Colour</td>
<td><input name="txtColour" type="text" id="txtColour"></td>
</tr>
<tr>
<td>Description</td>
<td><input name="txtDesc" type="text" id="txtDesc"></td>
<td>Coating</td>
<td><input name="txtCoating" type="text" id="txtCoating"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>Hardness</td>
<td><input name="txtHardness" type="text" id="txtHardness"></td>
</tr>
<tr>
<td>Supplier Name</td>
<td><select name="selSupp" id="selSupp" onchange="submit();">
<%
Set oRsSupp=Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT DISTINCT SupplierName FROM tblSupplier ORDER BY SupplierName"
oRsSupp.Open strSQL, ConnString
Response.Write "<OPTION>Please Select...</option>"
Do while not oRsSupp.EOF
if Request.Form("selSupp") = oRsSupp("SupplierName") then 'if this is the selected one then display as selected
Response.Write "<OPTION VALUE = '" & oRsSupp ("SupplierName") & "' SELECTED>"
Response.Write oRsSupp("SupplierName") & "</Option>"
oRsSupp.MoveNext
else
Response.Write "<OPTION VALUE = '" & oRsSupp ("SupplierName") & "'>"
Response.Write oRsSupp("SupplierName") & "</Option>"
oRsSupp.MoveNext
end if
loop
%>
</select>