logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > General
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 02-20-2007, 11:50 AM   #1
tux
tux's Avatar
 
Join Date: Feb 2007
Location: Isle of Wight, that little island right at the bottom of the UK
Posts: 657
Default Dynamic Jump Menu Link Problem

Hello,

Hope someone can help. I am trying to build a Dynamic Jump Menu populated from a database listing photographer names. The list itself works okay and the names are listed but I cant get them to link to the details page when a name is selected. I could also do with some help with getting the chosen photographers images and details onto the details page so that each photographer doesnt need its own page. I'm new to dynamic web design but I'm picking it up fast. Oh! I'm using ASP.

Thanks all, regards

Paul ( tux ) )
tux is offline   Reply With Quote
Old 02-20-2007, 12:20 PM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

was all set to help. Even had my sleeves rolled up ready to go. Even launched Dreamweaver as i was reading your post....

that was until i read the ASP bit..

sorry but its not my bag
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 02-20-2007, 03:35 PM   #3
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

give PHP a go

you might even like it
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 02-20-2007, 04:23 PM   #4
tux
tux's Avatar
 
Join Date: Feb 2007
Location: Isle of Wight, that little island right at the bottom of the UK
Posts: 657
Default

Thanks Davidj,

I have had a bit of a go at PHP. I struggled with MySQL tho'. Does PHP support Access databases?

The site I have been asked to upgrade is being run on hosting that doesnt support PHP, so I have had to plump for ASP.

What would your sollution to my problem be in PHP. I may be able to sort it out if I new what I was doing wrong. The recordset populates the list okay but I cant get the list values to link to the detail page. I have been using the book Dreamweaver MX 2004 with ASP, Coldfusion and PHP by Jeff Barbzell. It has taught me quite a bit but cant help with the jump list thing.

Thanks again Davidj, regards

Paul ( tux )
tux is offline   Reply With Quote
Old 02-20-2007, 04:36 PM   #5
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

if you have a site which is written in ASP then your going to have to stick to ASP im afraid.

give you an idea to your problem...

if you are successfully populating the menus from the database then its not ASP thats causing you problems as the code which controls your jump menus would be javascript.

please confirm you are dynamicaly creating the menus successfully. If this is the case then i will be able to help

if you want to give PHP ago on other projects then try these...

http://www.dreamweaverclub.com/vtm
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 02-20-2007, 05:01 PM   #6
tux
tux's Avatar
 
Join Date: Feb 2007
Location: Isle of Wight, that little island right at the bottom of the UK
Posts: 657
Default

Yes the jump menu is populated dynamically from the database using a record set. What I want to acheive is each item in the list to link to the detail page complete with the relevant info for that item.

The list is populated with photographer names, so each will link to the detail page and include image thumbnails from that photographer which in turn will link to the main image with image details such as title, shutter speed etc.

Not sure if I have explained that well but hope you can understand what I am trying to do.

Thanks

Paul )
tux is offline   Reply With Quote
Old 02-20-2007, 07:27 PM   #7
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

Quote:
What I want to acheive is each item in the list to link to the detail page complete with the relevant info for that item.
ok this is how you do it...

here is the main page with a Javascript function and a menu.

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>

<script language="javascript" type="text/javascript">
 
function submiter(){
 
id = document.getElementById('menu').value;
 
   if(id != '0'){
   document.location.href='detailpage.asp?id='+id;
   }
 
}
</script>

</head> 
<body>
<form id="form1" name="form1" method="post" action="">
  <select name="menu" onchange="submiter()">
    <option value="0">Select</option>
    <option value="1">no1</option>
 <option value="2">no2</option>
 <option value="3">no3</option>
  </select>
  
</form>
</body>
</html>
as you can see from the JS function i am using a document.location to target your details page (change the name accordingly) and im passing a value into that page using a querystring which is passed through the URL.

in the detail page i would use a $_GET to catch the id value but in ASP i think you use...

id = Request.QueryString(id)

The id is a recordset id which you would pass into a SQL query in the detail page so where you have your photographer details you would have an auto-id. Its this id you would pass through from the drop down to the detail page.

I have explained this the best i can with my limited knowledge of ASP
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 02-20-2007, 07:36 PM   #8
tux
tux's Avatar
 
Join Date: Feb 2007
Location: Isle of Wight, that little island right at the bottom of the UK
Posts: 657
Default

Thanks davidj,

I'll give it a go and let you know how I get on.

Regards

Paul
tux is offline   Reply With Quote
Old 02-21-2007, 10:31 PM   #9
tux
tux's Avatar
 
Join Date: Feb 2007
Location: Isle of Wight, that little island right at the bottom of the UK
Posts: 657
Default

Hello again Davidj,

Thanks for the help, I removed your list option values and re populated the list dynamically. It now works fine and sends the photographerID to the detail page URL, ie. gallery_detail.asp?photographerID=102

The problem is I cant get the info on the detail page to use the URL ID. I have tried using the Request.QueryString(id) as you suggested. Here is the code that Dreamweaver created, can you see what I'm doing wrong.

Code:
 
<%
Dim rs_thumbs
Dim rs_thumbs_numRows
Set rs_thumbs = Server.CreateObject("ADODB.Recordset")
rs_thumbs.ActiveConnection = MM_photolibraryadvanced_STRING
rs_thumbs.Source = "SELECT thumb_url FROM images WHERE photographerID= Request.QueryString(id)"
rs_thumbs.CursorType = 0
rs_thumbs.CursorLocation = 2
rs_thumbs.LockType = 1
rs_thumbs.Open()
rs_thumbs_numRows = 0
%>
I know ASP isnt your bag but thanks for your time anyway.

Regards

Paul
tux is offline   Reply With Quote
Old 02-22-2007, 06:05 AM   #10
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

im like a blind man looking for a black cat in a dark wood!

its like asking me to write a paper on quantum maths but in Tibetan!

i think you need single quotes in your QueryString('id') <<

also not sure if you need to declare the var id first...

Code:
dim id
try the first before the second

i would maybe try this...

Code:
 
dim id
 
id = request.QueryString('id')
 
select * from table where field = id
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Reply


Thread Tools
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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:40 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com