branding4you 0 Light Poster


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=# 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

str = str + "<table width=800>";
str = str + "<tr><input type='hidden' value='"[i].id+"'>";
str = str + "<td width=182 class=style13 rowspan=3><img src='"[i][i].fld_profile1+"' width=100 height=100></td>";
str = str + "<td width=463>" +[i].fld_hotelname + "</td>";
str = str + "<td width=139>&nbsp;</td>";
str = str + "</tr>";
str = str + "<tr>";
str = str + "<td rowspan=2>" +[i].fld_main + "</td>";
str = str + "<td> <a href= 'details.php?id=" +[i].id + "'> "  + "View Detail" +  "</a>" + "</td>";
str = str + "</tr>";
str = str + "<tr>";
str = str + "<td height=76><div align=center>Star Rating: " +[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


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.