Hello
I am running a php & java script that when searching for a property, it uses the onchange feature for three fields regarding the location of the property.
for example: Country, Parish, Area
When you choose a country, you then choose a Parish(which correspons to the country) and then an Area (that corresponds to the Parish)
Thing is, I am only using one country and would like the script to automatically show/filter to that country rather than 'Any'. For example I would want the Country field to show United Kingdom as a default.
What i want is to filter to first value(United Kingdom) by default in the dropdown (location1)
I checked on the net and it was suggested to have another javascript running after the listbox using selectedIndex=1 but I'm not sure how to implement it.
Any help would be greatly appreciated
Thanks
Last edited by PeejAvery; January 11th, 2009 at 07:23 PM.
You could use selectedIndex. It is very simple. The index corresponds to the <option> that you want to be preselected. However, it is not the best solution. You want to use the selected attribute in the <option> tag.
See the options come from a database and are not put in manually
I only just saw there is a java forum. SHould I post this query in there? Just checking
Thanks again
Bookmarks