branding4you 0 Light Poster

Hey

I have a serach page with several dropdowns that changes country state city as you select them, an then tehres type that has general best priced and special listed in it, (AJAX and javascript)

i want to change it so that when the user select "Specials" that it does not load the details.php?id=# page but specials.php?id=# page.in the types dropdown box that the specials page is in the URL "View Details"

Code looks like this (short version)

This section is the code that loads the rows

for(i=0;i<myObject.data.length;i++)
				{ 
str = str + "<table width=800>";
str = str + "<tr><input type='hidden' value='"+myObject.data[i].id+"'>";
str = str + "<td width=182 class=style13 rowspan=3><img src='"+myObject.data[i].fld_imgpath+myObject.data[i].fld_profile1+"' width=100 height=100></td>";
str = str + "<td width=463>" + myObject.data[i].fld_hotelname + "</td>";
str = str + "<td width=139>&nbsp;</td>";
str = str + "</tr>";
str = str + "<tr>";
str = str + "<td rowspan=2>" + myObject.data[i].fld_main + "</td>";
str = str + "<td> <a href= 'details.php?id=" + myObject.data[i].id + "'> "  + "View Detail" +  "</a>" + "</td>";
str = str + "</tr>";
str = str + "<tr>";
str = str + "<td height=76><div align=center>Star Rating: " + myObject.data[i].fld_rank + "</div></td>";
str = str + "</tr>";
str = str + "</table>";

				}

The line that has 'details.php' must change.

The variable on the type dropdown is done like this

var index4 = document.getElementById("types").selectedIndex;
var typeId = document.getElementById("types").options[index4].value;

So if Type has Special as the selected it must rather load page special.php than details.php

Thanx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.