944,111 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 4138
  • ASP RSS
Sep 30th, 2005
0

Passes variable when button is clicked...HELP!

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
spidey is offline Offline
53 posts
since Aug 2005
Oct 18th, 2005
0

Re: Passes variable when button is clicked...HELP!

ASP Syntax (Toggle Plain Text)
  1. <form id="form1" name="form1" method="get" action="next.asp">
  2. <select name="vendor" id="vendor">
  3. <option value="1">vendor1</option>
  4. <option value="2">vendor2</option>
  5. <option value="3">vendor3</option>
  6. <option value="4">vendor4</option>
  7. <option value="5">vendor5</option>
  8. </select>
  9. <input type="submit" name="Submit" value="Submit" />
  10. </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
Reputation Points: 10
Solved Threads: 2
Junior Poster
william_stam is offline Offline
131 posts
since Mar 2005
Oct 18th, 2005
0

Re: Passes variable when button is clicked...HELP!

wud it be possible if i use table not a dropdown list? :rolleyes:

thanks.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
spidey is offline Offline
53 posts
since Aug 2005
Jul 2nd, 2009
0

Re: Passes variable when button is clicked...HELP!

hey there i have the same problem with you. please let me know if yours has already solved. thanks!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
missbeginner is offline Offline
14 posts
since Jun 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: Constructing an A href link in CDO
Next Thread in ASP Forum Timeline: blabla.com/content/blabla/





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC