| | |
bu
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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
•
•
Join Date: Sep 2004
Posts: 89
Reputation:
Solved Threads: 1
yes it is possible,
Below is the code you can use.
Also you cam ommit the following line of code from ur page.
I am also confused if the propid will be same throughout the page? If it is same then above code will work fine, If not then tell me will it come from database? or from the Form Collection?
thanks
Below is the code you can use.
ASP Syntax (Toggle Plain Text)
<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> <td> <input type="hidden" name="propid"> value="<%=request.Form("propid")%>"> <input type="button" value=" Select " onClick="onClick="window.location.href='select_owner_update.asp?propid=<%=request.form("PropertyID")%>&vendorid=<%=rs("VendorID")%>';""> </td> </tr> <%rs.movenext loop%> </table>
Also you cam ommit the following line of code from ur page.
ASP Syntax (Toggle Plain Text)
<input type="hidden" name="propid"> value="<%=request.Form("propid")%>">
I am also confused if the propid will be same throughout the page? If it is same then above code will work fine, If not then tell me will it come from database? or from the Form Collection?
thanks
•
•
Join Date: Sep 2004
Posts: 89
Reputation:
Solved Threads: 1
You can get selected one record if u place all the records in a single form and place a radio button with each record with the same name and in the value field u set the ID for that record. Now Place one Submit button and when it is submitted you can get the Radio button value and do whatever u want...
I hope this may help u!!
I hope this may help u!!
hi again,
sorry if you find me stubborn :o but ah, hope this would be my last question regarding this. the code's ok now.
well actually, i would like to try something different. inside the do while loop of the records, can i assign an id that also loops for each record? like an incremeting numeric value, thus will become a unique id for each record. so what will be passed to the action page is the unique id of the record selected?
wud that be possible?
thanks a lot & more power!!
spidey
sorry if you find me stubborn :o but ah, hope this would be my last question regarding this. the code's ok now.
well actually, i would like to try something different. inside the do while loop of the records, can i assign an id that also loops for each record? like an incremeting numeric value, thus will become a unique id for each record. so what will be passed to the action page is the unique id of the record selected?
wud that be possible?
thanks a lot & more power!!
spidey
•
•
Join Date: Sep 2004
Posts: 89
Reputation:
Solved Threads: 1
yes u canhave a variable incrementing each time the record changes under the loop. Also u can concatinte that variable with the ID coming from the database
like
[code]Dim rd
rd=1
while NOT(RS.EOF)
rd=rd+1
rd= RS("id") & rd
RS.movenext
wend
[code]
like
[code]Dim rd
rd=1
while NOT(RS.EOF)
rd=rd+1
rd= RS("id") & rd
RS.movenext
wend
[code]
![]() |
Other Threads in the ASP Forum
- Previous Thread: updating records using asp and mysql
- Next Thread: how to display an attached image file in email
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection diagnostics dreamweaver excel fso iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit webserver windows7






, just like a datagrid and a button in visual basic.