Weather dropdown list problem? ? How the initial value. .

Category: Web Develop
 
helloipx
2008-11-10 12:31:19

Sponsored Links
<select name="selectweather" id="selectweather" onChange="qureyweather()">

<% for (int i = 0; i <areaname.size (); i + +) {
WeatherBean weather_areaname = (WeatherBean) areaname.get (i);%> ; / / Remove all traverse city name
<option value = "<% = weather_areaname.getAreaname ()%>"
<% if (request.getAttribute ("condition"). equals (weather_areaname.getAreaname ())) / / drop-down list to change the query selected weather

{out.print ("selected");}%> ;>
<% = weather_areaname.getAreaname ()%> </option> / / All cities dropdown
<%}
%>
</select>

user login location: bean.getArea ();
function has been achieved above table shows that the drop-down Fuzhou
Xiamen
; Beijing
Shanghai, etc. drop-down list and you can check the weather changing selection

now require users to login, so that the initial value of the drop-down list to display the user's location bean.getArea (), but do not just walk? ?
still keep changing the drop-down list, you can query selected weather.

Sponsored Links

shenzhen929
2008-11-10 12:39:12
not there a selected attributes? Selected by default
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.