I am creating a section of my company's webpage that will allow viewers to click on their state and the output will show what stores in that state carry which of our companies products. All the information is in a database which is available on my sites php myadmin.
I have been creating this as a modification of Adobes tutorial titled "Building a website with Web Premium CS4" using javascript, ajax, and spry. Everything works to the point where when I look at my page, the map shows and the entire database prints out showing the following columns "Store" " St_address" "City" "State" "Zip" "Product" .. Great.
But then, when I click on the state, Alabama (AL) for example, I receive the error, "AL" is undefined. The same error holds true for each state, replace state abbreviation for AL.
I am defining the following function in the Head tags,
var dsMap = new Spry.Data.XMLDataSet("CORRECT URL", "data/row", {sortOnLoad: "state", sortOrderOnLoad: "ascending"});
var showdetail = false;
function filterMap(state) {
showdetail = true;
dsMap.setCurrentRow(state);
Spry.Data.updateAllRegions();
}
then I have the states outlined using Photoshop CS4's hotspot tool, and call the script in the link field with the following,
javascript:filterMap(AL)
The appropriate state abbreviation in place for each state. The same state abbrevation is used in the the Database under the "state" field column.
I have been working on this for a while, and cant figure out how to properly define the state abbreviation. Any help is appreciated.