RSS Forums RSS
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 2744 | Replies: 2 | Thread Tools  Display Modes
Reply
Join Date: Aug 2005
Location: philippines
Posts: 47
Reputation: spidey is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
spidey's Avatar
spidey spidey is offline Offline
Light Poster

Help Passes variable when button is clicked...HELP!

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2005
Location: LTT, South Africa
Posts: 125
Reputation: william_stam is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
william_stam's Avatar
william_stam william_stam is offline Offline
Junior Poster

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

  #2  
Oct 18th, 2005
<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
Reply With Quote  
Join Date: Aug 2005
Location: philippines
Posts: 47
Reputation: spidey is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
spidey's Avatar
spidey spidey is offline Offline
Light Poster

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

  #3  
Oct 18th, 2005
wud it be possible if i use table not a dropdown list? :rolleyes:

thanks.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the ASP Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:48 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC