Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 24th, 2005, 06:15 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default value of the drop-down

<%
set rst1=con.execute("select * from company where company_id = '" & agencyid & "' and agencyid <> '"&agencyid&"'")
%>
<select name="searchby">

<% Do Until rst1.EOF %>
<option value="<%=trim(rst1("agencyid"))%>"><%=trim(rst1(" company_name"))%></option>
<%
rst1.movenext
loop
%>
                 </select>

<input name="timeoption" type="radio" value="option_bookings_only" onClick="location.href='option_agency_bookings.asp '">

how do i take the value of the drop-down menu i select on the page option_agency_bookings.asp




www.crmpicco.co.uk
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
Reply With Quote
  #2 (permalink)  
Old February 24th, 2005, 06:21 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Submit the form to the page rather than just changing the location & then get it from the Request object.

HTH,

Chris

Reply With Quote
  #3 (permalink)  
Old February 24th, 2005, 06:43 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

         <form name="form2" method="post" action="agency_bookdates.asp">
           <input name="agencyid" type="hidden" value="<%=agencyid%>">
           <tr bordercolor="#EEEEEE" bgcolor="#006699">
             <td colspan="3"><div align="left"><strong>MacKenzie - Agency - Booking Search </strong></div></td>
           </tr>
           <tr bordercolor="#EEEEEE" bgcolor="#EEEEEE">
             <td><div align="right">Search by </div></td>
             <td><div align="left">
<%
'response.write "agencyid = " & agencyid & "<br>"
set rst1=con.execute("select * from company where company_id = '" & agencyid & "' and agencyid <> '"&agencyid&"'")
user = rst1("agencyid")
%>
<select name="searchby">

<% Do Until rst1.EOF %>
<option value="<%=trim(rst1("agencyid"))%>"><%=trim(rst1(" company_name"))%></option>
<%
rst1.movenext
loop
%>
</select>
             </div></td>
             <td>&nbsp;</td>
           </tr>
           <tr bordercolor="#EEEEEE" bgcolor="#EEEEEE">
             <td width="263"><div align="right">Display all bookings that are </div></td>
             <td colspan="2"><div align="left">
                 <input name="timeoption" type="radio" value="current" checked>
             Current (Confirmed)</div></td>
           </tr>
           <tr bordercolor="#EEEEEE" bgcolor="#EEEEEE">
             <td><div align="right"></div></td>
             <td colspan="2"><div align="left">
                 <input name="timeoption" type="radio" value="pastdate">
             Past Date </div></td>
           </tr>
               <tr bordercolor="#EEEEEE" bgcolor="#EEEEEE">
             <td><div align="right"></div></td>
             <td colspan="2"><div align="left">
                 <input name="timeoption" type="radio" value="option_bookings_only" onClick="location.href='option_agency_bookings.asp '">
             Option Bookings </div></td>
           </tr>
<% if badlogin3 = "true" then%>
<tr bordercolor="#EEEEEE" bgcolor="#EEEEEE"><td colspan="3">
<div align="center">

Sorry, No Bookings Available!

</div>
</td></tr>
<%else%>
<tr><td></td></tr>
<%end if%>



           <tr bordercolor="#EEEEEE" bgcolor="#EEEEEE">
             <td>&nbsp;</td>
             <td>&nbsp;</td>
             <td><div align="right">
                 <input name="submit" type="submit" title='Click here to search the whole table by requested criteria' onMouseOver='style.cursor="hand"' value="Submit" width="100" height="25">
             </div></td>
           </tr>
         </form>

Thats the whole form.

as you can see the action is set to go to agency_bookdates.asp on submit. which i need. but if the Option Bookings radio button is clicked i need it to go to option_agency_bookings.asp and take the value of <select name="searchby">

www.crmpicco.co.uk
Reply With Quote
  #4 (permalink)  
Old February 24th, 2005, 06:53 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Change the action of the form when the option is clicked...
Code:
this.form.action = 'option_agency_bookings.asp'; this.form.submit();
Cheers,

Chris

Reply With Quote
  #5 (permalink)  
Old February 24th, 2005, 06:55 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

how do i do this?

www.crmpicco.co.uk
Reply With Quote
  #6 (permalink)  
Old February 24th, 2005, 06:58 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Just use it on the onclick of the radio button.



Reply With Quote
  #7 (permalink)  
Old February 24th, 2005, 08:47 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

Problem (again)

this works:

<input name="timeoption" type="radio" value="option_bookings_only" onClick="this.form.action = 'option_bookings.asp'; this.form.submit();">

but this doesnt:

<input name="timeoption" type="radio" value="option_bookings_only" onClick="this.form.action = 'option_agency_bookings.asp'; this.form.submit();">

Both pages exist, but i get a error:

"Object doesnt support this property or method"

why is this?

picco

www.crmpicco.co.uk
Reply With Quote
  #8 (permalink)  
Old February 24th, 2005, 10:03 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

onClick="this.form.action='option_agency_bookings. asp';this.form.submit();"

does 'form' need to be the name of the form?

as form2 doesnt work either.....

:-(

www.crmpicco.co.uk
Reply With Quote
  #9 (permalink)  
Old February 24th, 2005, 10:29 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

No, it just needs to be form - I think the problem may be that you have a submit button called submit - so the forms submit() method is not getting called correctly. Try changing the name to something else.

HTH,

Chris

Reply With Quote
  #10 (permalink)  
Old February 24th, 2005, 10:38 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

<input name="submit_button" type="submit" title='Click here to search the whole table by requested criteria' onMouseOver='style.cursor="hand"' value="Submit" width="100" height="25">

renamed it to submit_button

from submit

cheers

www.crmpicco.co.uk
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop down SKhna Javascript 1 January 25th, 2008 07:46 AM
drop down p2pMember ASP.NET 1.0 and 1.1 Basics 1 February 20th, 2006 06:34 AM
drop down list values based on another drop down noor ASP.NET 1.0 and 1.1 Basics 3 July 5th, 2005 09:57 AM
Drop down sinner Classic ASP Databases 2 March 19th, 2004 02:51 PM
Populating Drop Down based on other drop down jeffbarclay Java Databases 1 November 7th, 2003 12:14 PM



All times are GMT -4. The time now is 07:35 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.