PDA

View Full Version : Dynamic Jump Menu Link Problem


tux
02-20-2007, 11:50 AM
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 ) :o)

davidj
02-20-2007, 12:20 PM
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

davidj
02-20-2007, 03:35 PM
give PHP a go

you might even like it

tux
02-20-2007, 04:23 PM
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 )

davidj
02-20-2007, 04:36 PM
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

tux
02-20-2007, 05:01 PM
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 :o)

davidj
02-20-2007, 07:27 PM
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.


<!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

tux
02-20-2007, 07:36 PM
Thanks davidj,

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

Regards

Paul

tux
02-21-2007, 10:31 PM
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.


<%
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

davidj
02-22-2007, 06:05 AM
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...

dim id

try the first before the second

i would maybe try this...


dim id

id = request.QueryString('id')

select * from table where field = id