| | |
Passes variable when button is clicked...HELP!
Please support our ASP advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
I have a table displaying the list of vendors from the database.
I have to select one row (vendor details).
For VendorID:
------------------------Start---------------------
<table>
<tr>
<td>Name</td>
<td>Telephone</td>
<td>Email</td>
</tr>
<%do while not rs.eof%>
<tr>
<td onClick="HighLightTR('#cccccc','cc3333');"><input type="hidden" name="vendorid" value="<%=rs("VendorID")%>"><%=rs("Name")%></td>
<td><%=rs("Tel")%></td>
<td><%=rs("Email")%></td>
</tr>
<%rs.movenext
loop%>
</table>
--------------------------End-------------------------
The page also has the PropertyID which comes from the previous page.
For PropertyID:
-------------------------Start------------------------
<input type="hidden" name="propid"> value="<%=request.Form("propid")%>">
--------------------------End-------------------------
The [vendor] record selected is highlighted (i did not put the javascript script for highlighting in here). If the user click the button (below) or an image link, the 'PropertyID' and 'VendorID' will be passed on to the next page, then display the details of the vendor selected.
For button:
-------------------------Start-------------------------
<input type="button" value=" Select " onClick="onClick="window.location.href='select_owner_update.asp?propid=<%=ra("PropertyID")%>&vendorid=<%=rs("VendorID")%>';"">
--------------------------End--------------------------
Would that be possible?
How? :-| Can somebody help me with this problem?
Have a nice day!
Lots of thanks,
Francis
I have to select one row (vendor details).
For VendorID:
------------------------Start---------------------
<table>
<tr>
<td>Name</td>
<td>Telephone</td>
<td>Email</td>
</tr>
<%do while not rs.eof%>
<tr>
<td onClick="HighLightTR('#cccccc','cc3333');"><input type="hidden" name="vendorid" value="<%=rs("VendorID")%>"><%=rs("Name")%></td>
<td><%=rs("Tel")%></td>
<td><%=rs("Email")%></td>
</tr>
<%rs.movenext
loop%>
</table>
--------------------------End-------------------------
The page also has the PropertyID which comes from the previous page.
For PropertyID:
-------------------------Start------------------------
<input type="hidden" name="propid"> value="<%=request.Form("propid")%>">
--------------------------End-------------------------
The [vendor] record selected is highlighted (i did not put the javascript script for highlighting in here). If the user click the button (below) or an image link, the 'PropertyID' and 'VendorID' will be passed on to the next page, then display the details of the vendor selected.
For button:
-------------------------Start-------------------------
<input type="button" value=" Select " onClick="onClick="window.location.href='select_owner_update.asp?propid=<%=ra("PropertyID")%>&vendorid=<%=rs("VendorID")%>';"">
--------------------------End--------------------------
Would that be possible?
How? :-| Can somebody help me with this problem?Have a nice day!
Lots of thanks,
Francis
ASP Syntax (Toggle Plain Text)
<form id="form1" name="form1" method="get" action="next.asp"> <select name="vendor" id="vendor"> <option value="1">vendor1</option> <option value="2">vendor2</option> <option value="3">vendor3</option> <option value="4">vendor4</option> <option value="5">vendor5</option> </select> <input type="submit" name="Submit" value="Submit" /> </form>
then on your contact page have a recordset retrieve the values from the dbase using response.querystring("vendor") the above code sends the vale to the option in a querystring
![]() |
Similar Threads
- command button (Visual Basic 4 / 5 / 6)
- how to get to next record on click of a button. (JavaScript / DHTML / AJAX)
- display image when button clicked (Java)
- Get visual basic to bring up another form when a button is clicked (Visual Basic 4 / 5 / 6)
- Need help to encrypt and decrypt password in VB (Visual Basic 4 / 5 / 6)
Other Threads in the ASP Forum
- Previous Thread: dropdownlist value doesnt get selected
- Next Thread: blabla.com/content/blabla/
| Thread Tools | Search this Thread |
archive asp aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection





