SunQuest
           ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old August 15th, 2003, 03:34 PM
mazbball32 mazbball32 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 22 mazbball32 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Drop-Down Boxes

I want to make a drop-down box that has 7 different choices in it, and I want each choice to open a webpage with info related to the choice on it. I have my drop-down box and each choice has a value, but I am unsure what I need to do next as far as making each choice go and grab the page that the value represents.

My index page is created with frames if this matters.

Thanks,

Tim

Reply With Quote
  #2  
Old August 15th, 2003, 05:49 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
booo to frames i say

i don't think so, i'm sure someone smart knows a good way, but my sloppy ways:

when you submit, have the form submit to itself, and the first line checks request.form("dropdown") and do a case or if then's etc to response.redirect "page you want.asp", or however you load a page in frames, i don't use them so i can't tell you exactly but that's the logic....

another way around is using javascript to just open up a new window completely...

Last edited by unatratnag : August 15th, 2003 at 05:55 PM.

Reply With Quote
  #3  
Old August 16th, 2003, 01:56 AM
yassoor's Avatar
yassoor yassoor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Canada - Egypt
Posts: 60 yassoor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Four ways to do it

I agree with unatratnag

you could have the form re post to itself and from there decide which page to view ... this will result in the new pages opening inside the frames ....

if you don't want that (opening inside the frame) .. you would have the post done to the index page instead of the same page ...

also this could be done by client side scripting javascripting ...

let us know which way you wish to have it done (in frame or out of it) .. and which scripting is better for you "easier to learn" and we could give you more detailed guide lines
__________________
I hope this is of any help to anyone.

Yassoor
http://www.WebsitesCreation.ca

Reply With Quote
  #4  
Old August 18th, 2003, 10:36 AM
mazbball32 mazbball32 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 22 mazbball32 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Undecided

Well I would rather do it in java because I'll get exactly what I want doing it that way. I would like to keep the frames and just open the pages inside the frames from the drop-down list.

Thanks guys hopefully I can get this stupid page built.

Reply With Quote
  #5  
Old August 18th, 2003, 03:52 PM
aspman aspman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Ashburn,VA
Posts: 105 aspman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 22 m 40 sec
Reputation Power: 5
you can use Client Side JAVASCRIPT to acheive that pretty easily.

have your webpage link as

<option value="http://www.devshed.com"> devshed </option>

and a button below it which opens the url with something like this

< button onClick= window.open( combo.value) >

Reply With Quote
  #6  
Old August 19th, 2003, 01:59 PM
mazbball32 mazbball32 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 22 mazbball32 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
here's what I got...

here's the combo box information that I have, can you help me insert the code you sent me into this so it will work correctly.


td HEIGHT="20" width="156" style="border-style: none; border-width: medium; ">
<font style="font-weight: 700">Phone Directory</font><font size="2" face="Arial, MS Sans Serif, sans-serif"><small><select size="1" name="MakeId" class="FormText" onChange="SelectList(0,'make');">
<OPTION VALUE="0" SELECTED>Location</OPTION>
<OPTION VALUE="1">Sixth St.</OPTION>
<OPTION VALUE="2">Main St.</OPTION>
<OPTION VALUE="3">Campus</OPTION>
<OPTION VALUE="4">La Pine</OPTION>
<OPTION VALUE="5">Gilchrist</OPTION>
<OPTION VALUE="6">Lakeview</OPTION>
<OPTION VALUE="7">Medford</OPTION>
</select></small></font></td>
</tr>
</table>
</body>
</html>

Last edited by mazbball32 : August 19th, 2003 at 02:01 PM.

Reply With Quote
  #7  
Old August 19th, 2003, 02:44 PM
aspman aspman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Ashburn,VA
Posts: 105 aspman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 22 m 40 sec
Reputation Power: 5
here you go


<select size="1" name="MakeId" class="FormText" onChange="SelectList(0,'make');">
<OPTION VALUE="0" SELECTED>Location</OPTION>
<OPTION VALUE="http://forums.devshed.com/t76984/s.html">Sixth St.</OPTION>
<OPTION VALUE="http://www.yahoo.com">Main St.</OPTION>
<OPTION VALUE="http://www.aspfree.com">Campus</OPTION>
<OPTION VALUE="http://www.devguru.com">La Pine</OPTION>
<OPTION VALUE="5">Gilchrist</OPTION>
<OPTION VALUE="6">Lakeview</OPTION>
<OPTION VALUE="7">Medford</OPTION>
</select>

<input type=button name="winopener" value="Go" onClick=window.open(MakeId.value)>

Reply With Quote
  #8  
Old August 19th, 2003, 03:46 PM
mazbball32 mazbball32 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 22 mazbball32 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
it works! but...

It all works great, but I'm getting an error in this line:

<OPTION VALUE="0" SELECTED>Location</OPTION>

I'm going to attach to this post a picture of the error I'm getting.
Attached Images
File Type: gif script error.gif (6.1 KB, 250 views)

Reply With Quote
  #9  
Old August 19th, 2003, 03:49 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
well if location isn't an option and not needed, you'll probably check in javascript to not select that right? so don't give it a value at all, or if you have to for a reason i can't think of right now, say value = "". If you don't specify a value the name displayed (Location) will be what the GET/POST displays for the select.

Reply With Quote
  #10  
Old August 20th, 2003, 09:36 AM
aspman aspman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Ashburn,VA
Posts: 105 aspman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 22 m 40 sec
Reputation Power: 5
yes obviously.. Since there is no URL attached to "Location", it would fail.. I gave you a test script. It is not a bullet proof script. I dont know what you might need and if you need all the options.

One limitation of the script is that, it doesnot check for a valid URL. It expects a valid URL. So, it is unto you to fill the "option value" with valid URLs. If you dont need some of em, remove the options.

Reply With Quote
  #11  
Old August 20th, 2003, 10:34 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
yea, aspman's statement makes me retract mine,
Quote:
well if location isn't an option and not needed, you'll probably check in javascript to not select that right? so don't give it a value at all, or if you have to for a reason i can't think of right now,


There is no reason, use javascript to make sure you just don't select that top option. Aspman's script works fine as is and add some java validation to make sure the Location value isn't selected.

Reply With Quote
  #12  
Old August 20th, 2003, 05:47 PM
mazbball32 mazbball32 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 22 mazbball32 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you everyone

I've got it!!! It works great and I don't have any errors. The urls are opening in their own windows instead of within the frame, but I can deal with that. If someone knows a way to make it open within the frame then that's great, if not no biggy.

Thanks for everything

Reply With Quote
  #13  
Old August 21st, 2003, 05:29 PM
mazbball32 mazbball32 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 22 mazbball32 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
One more thing...

Alright first day of use went pretty good, but everyone wants it to open within the frame. I know that it's just a comand and i'm almost sure it's in this syntax:

<input type=button name="winopener" value="Go" onClick=window.refresh(MakeId.value)>

can somone please let me know what the "onClick" command is to open my values inside of my frame?

Reply With Quote
  #14  
Old August 22nd, 2003, 04:50 PM
aspman aspman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Ashburn,VA
Posts: 105 aspman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 22 m 40 sec
Reputation Power: 5
i guess you cannot use window.open if you want to open in the same frame. I need to check some html. I will check and let you know

Reply With Quote
  #15  
Old August 25th, 2003, 01:52 PM
aspman aspman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Ashburn,VA
Posts: 105 aspman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 22 m 40 sec
Reputation Power: 5
window.open(URL, name [, features])

The documentation says, if you specify the name as the name of the frame name. you should be opening the page in that frame.

I have not tried it though.

so, you would be doing

window.open('http://www.yahoo.com','myframe')

where 'myframe' is the name of the frame

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Drop-Down Boxes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump