bu

Reply

Join Date: Aug 2005
Posts: 52
Reputation: spidey is an unknown quantity at this point 
Solved Threads: 0
spidey's Avatar
spidey spidey is offline Offline
Junior Poster in Training

bu

 
0
  #1
Sep 30th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 89
Reputation: msaqib is an unknown quantity at this point 
Solved Threads: 1
msaqib msaqib is offline Offline
Junior Poster in Training

Re: bu

 
0
  #2
Nov 6th, 2005
yes it is possible,
Below is the code you can use.

  1. <table>
  2. <tr>
  3. <td>Name</td>
  4. <td>Telephone</td>
  5. <td>Email</td>
  6. </tr>
  7. <%do while not rs.eof%>
  8. <tr>
  9. <td onClick="HighLightTR('#cccccc','cc3333');"><input type="hidden" name="vendorid" value="<%=rs("VendorID")%>"><%=rs("Name")%></td>
  10. <td><%=rs("Tel")%></td>
  11. <td><%=rs("Email")%></td>
  12. <td>
  13. <input type="hidden" name="propid"> value="<%=request.Form("propid")%>">
  14. <input type="button" value=" Select " onClick="onClick="window.location.href='select_owner_update.asp?propid=<%=request.form("PropertyID")%>&vendorid=<%=rs("VendorID")%>';"">
  15. </td>
  16. </tr>
  17. <%rs.movenext
  18. loop%>
  19. </table>


Also you cam ommit the following line of code from ur page.

  1. <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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 52
Reputation: spidey is an unknown quantity at this point 
Solved Threads: 0
spidey's Avatar
spidey spidey is offline Offline
Junior Poster in Training

Re: bu

 
0
  #3
Nov 7th, 2005
hi,

just thanking you for the reply. :surprised
i just hope there's a way i can put a single button that can be used to transfer the IDs of whichever record selected , just like a datagrid and a button in visual basic.

more power to you & daniweb!!

francis
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 89
Reputation: msaqib is an unknown quantity at this point 
Solved Threads: 1
msaqib msaqib is offline Offline
Junior Poster in Training

Re: bu

 
0
  #4
Nov 7th, 2005
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!!
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 52
Reputation: spidey is an unknown quantity at this point 
Solved Threads: 0
spidey's Avatar
spidey spidey is offline Offline
Junior Poster in Training

Re: bu

 
0
  #5
Nov 8th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 89
Reputation: msaqib is an unknown quantity at this point 
Solved Threads: 1
msaqib msaqib is offline Offline
Junior Poster in Training

Re: bu

 
0
  #6
Nov 8th, 2005
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]
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC