473,850 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need helpf with javascript if else

I need to set up an if else to show different weather scripts based on
the city selection they choose. Any help on this would be great.
Thanks!
<%@ page language="java" import="java.ut il.*, java.text.* " %>
<%@ page import="com.plu mtree.remote.po rtlet.*" %>
<%@ page import="com.plu mtree.remote.pr c.*" %>
<%
String path = request.getCont extPath();
String basePath =
request.getSche me()+"://"+request.getSe rverName()+":"+ request.getServ erPort()+path+"/";
%>
<% response.setHea der("Cache-Control", "max-age=3400"); %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePa th%>">

<title>Weathe r</title>

<!-- <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0"> -->
<meta http-equiv="keywords " content="keywor d1,keyword2,key word3">
<meta http-equiv="descript ion" content="This is my page">

<!--
<link rel="stylesheet " type="text/css" href="styles.cs s">
<link rel='stylesheet '
href='pt://images/plumtree/portal/custom/fh_styles/style.css'>
-->
<body>
<table>
<tr><td>
<script>

if (city="albany")
{
open("http://voap.weather.co m/weather/oap/USTX0016?templa te=GENXH&par=nu ll&unit=0&key=b a8a960da1889129 5bbc4cfea6a0dbe 2");

}
else if(city="amster dam")
{
window.open("ht tp://voap.weather.co m/weather/oap/NLXX0002?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if(city="atlant a")
{

window.open("ht tp://voap.weather.co m/weather/oap/USGA0028?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='austin')
{

String("http://voap.weather.co m/weather/oap/USTX0057?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='beijing' )
{

String("http://voap.weather.co m/weather/oap/CHXX0008?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='berlin')
{

String("http://voap.weather.co m/weather/oap/GMXX0007?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='boston')
{

String("http://voap.weather.co m/weather/oap/USMA0046?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='brussels ')
{

String("http://voap.weather.co m/weather/oap/BEXX0005?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='buffalo' )
{

String("http://voap.weather.co m/weather/oap/USNY0181?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='calgary' )
{

String("http://voap.weather.co m/weather/oap/CAXX0054?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e'")
}
else if (city='charlott e')
{

String("http://voap.weather.co m/weather/oap/USNC0121?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e'")
}
else if (city='chicago' )
{

String("http://voap.weather.co m/weather/oap/USIL0225?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e'")
}
else if (city='clevelan d')
{

String("http://voap.weather.co m/weather/oap/USOH0195?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='dallas')
{

String("http://voap.weather.co m/weather/oap/USTX0327?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='detroit' )
{

String("http://voap.weather.co m/weather/oap/USMI0229?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='dublin')
{

String("http://voap.weather.co m/weather/oap/EIXX0014?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='edinburg h')
{

String("http://voap.weather.co m/weather/oap/UKXX0052?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e'")
}
else if (city='edmonton ')
{

String("http://voap.weather.co m/weather/oap/ASXX0036?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='frankfur t')
{

String("http://voap.weather.co m/weather/oap/GMXX0185?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='hongkong ')
{

String("http://voap.weather.co m/weather/oap/CHXX0049?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='houston' )
{

String("http://voap.weather.co m/weather/oap/USTX0617?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='johannes burg')
{

String("http://voap.weather.co m/weather/oap/SFXX0023?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='kansasci ty')
{

String("http://voap.weather.co m/weather/oap/USMO0460?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='kualalum pur')
{

String("http://voap.weather.co m/weather/oap/MYXX0008?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='london')
{

String("http://voap.weather.co m/weather/oap/UKXX0085?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='losangel es')
{

String("http://voap.weather.co m/weather/oap/USCA0638?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='madrid')
{

String("http://voap.weather.co m/weather/oap/SPXX0050?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='manila')
{

String("http://voap.weather.co m/weather/oap/RPXX0017?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='melbourn e')
{

String("http://voap.weather.co m/weather/oap/ASXX0075?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='mexico')
{

String("http://voap.weather.co m/weather/oap/MXDF0132?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='miami')
{

String("http://voap.weather.co m/weather/oap/USFL0316?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='milan')
{

String("http://voap.weather.co m/weather/oap/ITXX0042?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='minneapo lis')
{

String("http://voap.weather.co m/weather/oap/USMN0503?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='montreal ')
{

String("http://voap.weather.co m/weather/oap/CAXX0301?templa te=GENXH&par=nu ll&unit=1&key=9 1722c3a3c6b8b30 2602ce2bf13950a e")
}
else if (city='munich')
{

String("http://voap.weather.co m/weather/oap/GMXX0087?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='neworlea ns')
{

String("http://voap.weather.co m/weather/oap/USLA0338?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='newyork' )
{

String("http://voap.weather.co m/weather/oap/USNY0996?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='ottawa')
{

String("http://voap.weather.co m/weather/oap/CAXX0343?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='paris')
{

String("http://voap.weather.co m/weather/oap/FRXX0076?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='portland ')
{

String("http://voap.weather.co m/weather/oap/USOR0275?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='prague')
{

String("http://voap.weather.co m/weather/oap/EZXX0012?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='quebec')
{

String("http://voap.weather.co m/weather/oap/CAXX0385?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='raleighd urham')
{

String("http://voap.weather.co m/weather/oap/USNC0558?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='sacramen to')
{

String("http://voap.weather.co m/weather/oap/USCA0967?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='sananton io')
{

String("http://voap.weather.co m/weather/oap/USTX1200?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='sandiego ')
{

String("http://voap.weather.co m/weather/oap/USCA0982?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='sanfranc isco')
{

String("http://voap.weather.co m/weather/oap/USCA0987?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='sanjuan' )
{

String("http://voap.weather.co m/weather/oap/PEXX0047?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='seattle' )
{

String("http://voap.weather.co m/weather/oap/USWA0395?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='seoul')
{

String("http://voap.weather.co m/weather/oap/KSXX0037?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='shanghai ')
{

String("http://voap.weather.co m/weather/oap/CHXX0116?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='singapor e')
{

String("http://voap.weather.co m/weather/oap/SNXX0006?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='StLouis' )
{

String("http://voap.weather.co m/weather/oap/63102?template= GENXH&par=null& unit=0&key=67d2 b0264796112ce6d 75944acad734e")
}
else if (city='sydney')
{

String("http://voap.weather.co m/weather/oap/ASXX0112?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='tokyo')
{

String("http://voap.weather.co m/weather/oap/JAXX0085?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='toronto' )
{

String("http://voap.weather.co m/weather/oap/CAXX0504?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if (city='vancouve r')
{

String("http://voap.weather.co m/weather/oap/CAXX0518?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
else if(city='warsaw ')
{

String("http://voap.weather.co m/weather/oap/PLXX0028?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e")
}
</script>

</td></tr></table>
</body>

Jan 19 '06 #1
4 2323
Br**********@ho tmail.com wrote in
news:11******** **************@ g14g2000cwa.goo glegroups.com:
I need to set up an if else to show different weather scripts based on
the city selection they choose. Any help on this would be great.
Thanks!

You sure do need help, doncha?

<%@ page language="java" import="java.ut il.*, java.text.* " %>
<%@ page import="com.plu mtree.remote.po rtlet.*" %>
<%@ page import="com.plu mtree.remote.pr c.*" %>
<%
String path = request.getCont extPath();
String basePath =
request.getSche me()+"://"+request.getSe rverName()+":"+ request.getServ er
Port()+path+"/"; %>
<% response.setHea der("Cache-Control", "max-age=3400"); %>

The above is some sort of server-specific stuff, huh? Active server page-
type stuff?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePa th%>">

<title>Weathe r</title>

<!-- <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0"> -->
<meta http-equiv="keywords " content="keywor d1,keyword2,key word3">
<meta http-equiv="descript ion" content="This is my page">

<!--
<link rel="stylesheet " type="text/css" href="styles.cs s">
<link rel='stylesheet '
href='pt://images/plumtree/portal/custom/fh_styles/style.css'>
-->
<body>
<table>
<tr><td>
<script>
Okay, you have embedded script into a one-cell table. Any reason why?
It's quite okay to have script contained in just a bare body. (Did I just
say that?)

It would be a good idea to include the script element's TYPE attribute
rather than to assume any defaults:

<script type="text/javascript">
if (city="albany")
Error: variable city undefined
Where did you assign 'city' a value prior to your use of it?

Warning: variable 'city' is assigned string constant "albany" rather than
compared to it. Condition always evaluates true.

Did you want to know if city == "albany", or did you want to make
the city have the string value "albany"?

By the way, you may run into trouble if you say, city == "albany" since
names of cities are often capitalized. If you want to be safe in comparing
strings whose case you may not know, try:

if (city.toLowerCa se() == "albany")
{
open("http://voap.weather.co m/weather/oap/USTX0016?templa te=GENXH&par=n
ull&unit=0&key= ba8a960da188912 95bbc4cfea6a0db e2");
This script line will always be executed if you use an assignment rather
than a comparison in your conditional test. That's quite a URL there. Do
you need to escape it...i.e., use the function urlEncode()??
}
else if(city="amster dam")
Again, you'll want to correct all of these comparisons
{
window.open("ht tp://voap.weather.co m/weather/oap/NLXX0002?templa te=GENX
H&par=null&unit =0&key=67d2b026 4796112ce6d7594 4acad734e")
}
else if(city="atlant a")
{

window.open("ht tp://voap.weather.co m/weather/oap/USGA0028?templa te=GENX
H&par=null&unit =0&key=67d2b026 4796112ce6d7594 4acad734e")
}
else if (city='austin')
{

String("http://voap.weather.co m/weather/oap/USTX0057?templa te=GENXH&par
=null&unit=0&ke y=67d2b02647961 12ce6d75944acad 734e")
Hmmm....you create a string object and assign it to nothing. Was this
supposed to open a window as well?

Same down below.

By the way, I encourage you to end Javascript statements in semicolons,
although I know there are two sides to this issue. The heritage of
Javascript is such that its statements end in semicolons.
}
else if (city='beijing' )
{

String("http://voap.weather.co m/weather/oap/CHXX0008?templa te=GENXH&par
=null&unit=1&ke y=67d2b02647961 12ce6d75944acad 734e")
}

You know, while that series of if-else blocks will certainly, I recommend
something more readable, at least for me.

Why not try this?

var cityWeather = [
{ cityName: "city1name" ,
weatherURL: "http://my.weather.url/for/city?number=1" },
{ cityName: "city2name" ,
weatherURL: "http://my.weather.url/for/city?number=2" },
{ cityName: "city13ame" ,
weatherURL: "http://my.weather.url/for/city?number=3" },
{ cityName: "city4name" ,
weatherURL: "http://my.weather.url/for/city?number=4" },
{ cityName: "city5name" ,
weatherURL: "http://my.weather.url/for/city?number=5" }
// as many 2-property objects as you have cities and weather
];

for (var i = 0; i < cityWeather.len gth; i++)
if (city.toLowerCa se() == cityWeather[i].cityName.toLow erCase())
{
open (cityWeather[i].weatherURL);
break;
}

An array of identical unnamed objects having two properties, cityName and
weatherURL.

Note that this is untested script, so a bug or two might need working out.

Alternative is to make two vectors (arrays), one of city names with a one-
to-one correspondence with your URLs.

The idea is that it is more tabular, which makes it more readable than a
series of if-else.


</script>

</td></tr></table>
</body>


Jan 19 '06 #2
Thanks for all of the help! Yeah i'm kind of lost on this. Yeah there
are two other pages that work with this one. This is for a portlet
within a portal. So it has to be set up kind of differently. There
are 3 pages. This is the display page. There is an edit page and then
a set user prefs page off of the edit page. I'll put those in here
too. Here's the changes I made according to what I think you said.

Display weather page:
<%@ page language="java" import="java.ut il.*, java.text.* " %>
<%@ page import="com.plu mtree.remote.po rtlet.*" %>
<%@ page import="com.plu mtree.remote.pr c.*" %>
<%
String path = request.getCont extPath();
String basePath =
request.getSche me()+"://"+request.getSe rverName()+":"+ request.getServ erPort()+path+"/";
%>
<% response.setHea der("Cache-Control", "max-age=3400"); %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePa th%>">

<title>Weathe r</title>

<!-- <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0"> -->
<meta http-equiv="keywords " content="keywor d1,keyword2,key word3">
<meta http-equiv="descript ion" content="This is my page">

<!--
<link rel="stylesheet " type="text/css" href="styles.cs s">
<link rel='stylesheet '
href='pt://images/plumtree/portal/custom/fh_styles/style.css'>
-->
<body>
<table>
<tr><td>
<script type="text/javascript">
var cityWeather = [
{ cityName: "austin",
weatherURL:
"http://voap.weather.co m/weather/oap/NLXX0002?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e"
},
{ cityName: "albany",
weatherURL:
"http://voap.weather.co m/weather/oap/USGA0028?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e"
},
{ cityName: "amsterdam" ,
weatherURL:
"http://voap.weather.co m/weather/oap/USTX0057?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e"
},
{ cityName: "beijing",
weatherURL:
"http://voap.weather.co m/weather/oap/CHXX0008?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e"
},
{ cityName: "melbourne" ,
weatherURL:
"http://voap.weather.co m/weather/oap/GMXX0007?templa te=GENXH&par=nu ll&unit=1&key=6 7d2b0264796112c e6d75944acad734 e"
}
// as many 2-property objects as you have cities and weather
];

for (var i = 0; i < cityWeather.len gth; i++)
if (city.toLowerCa se() ==
cityWeather[i].cityName.toLow erCase())
{
open (cityWeather[i].weatherURL);
break;
}
</script>
</td></tr></table>
</body>

User Prefs Page:
<%@ page language="java" import="java.ut il.*" %>
<%@ page import="com.plu mtree.remote.po rtlet.*" %>
<%@ page import="com.plu mtree.remote.pr c.*" %>
<%
String path = request.getCont extPath();
String basePath =
request.getSche me()+"://"+request.getSe rverName()+":"+ request.getServ erPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePa th%>">

<title>Edit Preferences</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords " content="keywor d1,keyword2,key word3">
<meta http-equiv="descript ion" content="This is my page">

<!--
<link rel="stylesheet " type="text/css" href="styles.cs s">
-->

<link rel='stylesheet '
href='pt://images/plumtree/portal/custom/fh_styles/style.css'>

<script LANGUAGE="JavaS cript">
<!--
window.moveTo(1 00,100);
if (window.screen) self.resizeTo(W idth=700,Height =400);

//-->
</script>

</head>

<body>
<%
String cityName = null;
try
{
//get portlet context obj
IPortletContext portletContext =
PortletContextF actory.createPo rtletContext(re quest, response);
IRemoteSession remoteSession =
portletContext. getRemotePortal Session();

//Get portlet context object
IPortletRequest portletRequest = portletContext. getRequest();
cityName = portletRequest. getSettingValue (SettingType.Us er,
"cityName") ;
if (cityName != null)
{
System.out.prin tln("FHWeather: userPrefs: previous selected
cityName = " + cityName);
}
}
catch(Exception ex)
{
ex.printStackTr ace();
}
%>
<form name="userprefs " method="post" action="setUser Prefs.jsp"
id="userPrefs" >
<table width="100%" cellspacing="0" cellpadding="0" >
<tr>
<td colspan=4
background="pt://images/plumtree/portal/custom/fh_images/rec_port_graphi cs/horiz_greyrule. gif">
<img
src="pt://images/plumtree/portal/custom/fh_images/rec_port_graphi cs/tr.gif"
width="1" height="1"></td>
</tr>
<tr><td colspan=4><p class="pagetitl e">Edit Preferences</p>
<p class="pagetext ">Use this page to Edit preferences for this
portlet. Click Submit to return to the previous page.</p></td></tr>
<tr><td width="29%">&nb sp;</td></tr>
<tr>
<td colspan=4
background="pt://images/plumtree/portal/custom/fh_images/rec_port_graphi cs/horiz_greyrule. gif">
<img
src="pt://images/plumtree/portal/custom/fh_images/rec_port_graphi cs/tr.gif"
width="1" height="1"></td>
</tr>
<tr>
<td valign="top" class="bodytext ">Select the cities weather:</td>
<td valign="top" align="left" width="20%"> <table>
<% if (cityName != null && cityName.equals IgnoreCase("alb any"))
{
%>
<tr><td width="126" align="left" class="bodytext "><input
type="radio" name="cityName" value="Albany" checked>Albany</td></tr>
<% }
else
{ %>
<tr><td align="left" class="bodytext "><input type="radio"
name="cityName" value="Albany" >Albany</td></tr>
<% } %>
</table></td>
<td valign="top" align="left" width="20%"><ta ble>
<% if (cityName != null &&
cityName.equals IgnoreCase("ams terdam"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Amsterda m" checked>
Amsterdam</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Amsterda m" >
Amsterdam</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left" width="20%"><ta ble>
<% if (cityName != null &&
cityName.equals IgnoreCase("atl anta"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Atlanta" checked>
Atlanta</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Atlanta" >
Atlanta</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("aus tin"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Austin" checked>
Austin</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Austin" >
Austin</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("bei jing"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Beijing" checked>
Beijing</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Beijing" >
Beijing</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("ber lin"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Berlin" checked>
Berlin</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Berlin" >
Berlin</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("bos ton"))
{
%>
<tr>
<td width="143" align="left" class="bodytext "><input
type="radio" name="cityName" value="Boston" checked>
Boston</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Boston" >
Boston</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("bru ssels"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Brussels " checked>
Brussels</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Daily" >
Brussels</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("buf falo"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Buffalo" checked>
Buffalo</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Buffalo" >
Buffalo</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("cal gary"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Calgary" checked>
Calgary</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Calgary" >
Calgary</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("cha rlotte"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Charlott e" checked>
Charlotte</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Charlott e" >
Charlotte</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("chi cago"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Chicago" checked>
Chicago</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Chicago" >
Chicago</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("cle veland"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Clevelan d" checked>
Albany</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Clevelan d" >
Cleveland</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("dal las"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Dallas" checked>
Dallas</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Dallas" >
Dallas</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("det roit"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Detroit" checked>
Detroit</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Detroit" >
Detroit</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("dub lin"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Dublin" checked>
Dublin</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Dublin" >
Dublin</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("edi nburgh"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Edinburg h" checked>
Edinburgh</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Edinburg h" >
Edinburgh</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("edm onton"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Edmonton " checked>
Edmonton</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Edmonton " >
Edmonton</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("fra nkfurt"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Frankfur t" checked>
Frankfurt</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Frankfur t" >
Frankfurt</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("hon gkong"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="HongKong " checked>
Hong Kong</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="HongKong " >
Hong Kong</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("hou ston"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Houston" checked>
Houston</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Houston" >
Houston</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("joh annesburg"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Johannes burg" checked>
Johannesburg</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Johannes burg" >
Johannesburg</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("kan sascityName"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Kansasci tyName" checked>
Kansas cityName</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Kansasci tyName" >
Kansas cityName</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("kua lalumpur"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="KualaLum pur" checked>
Kuala Lumpur</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Kuala Lumpur" >
Kuala Lumpur</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("lon don"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="London" checked>
London</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="London" >
London</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("los angeles"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="LosAngel es" checked>
Los Angeles</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Los Angeles" >
Los Angeles</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("mad rid"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Madrid" checked>
Madrid</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Madrid" >
Madrid</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("man ila"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Manila" checked>
Manila</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Manila" >
Manila</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("mel bourne"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Melbourn e" checked>
Melbourne</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Melbourn e" >
Melbourne</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("mex ico"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Mexico" checked>
Mexico</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Mexico" >
Mexico</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("mia mi"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Miami" checked>
Miami</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Miami" >
Miami</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("mil an"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Milan" checked>
Milan</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Milan" >
Milan</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("min neapolis"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Minneapo lis" checked>
Minneapolis/St. Paul</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Minneapo lis" >
Minneapolis/St. Paul</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("mon treal"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Montreal " checked>
Montreal</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Montreal " >
Montreal</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("mun ich"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Munich" checked>
Munich</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Munich" >
Munich</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("new orleans"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="NewOrlea ns" checked>
New Orleans</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="New Orleans" >
New Orleans</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("new york"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="NewYork" checked>
New York</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="New York" >
NewYork</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("ott awa"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Ottawa" checked>
Ottawa</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Ottawa" >
Ottawa</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("par is"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Paris" checked>
Paris</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Paris" >
Paris</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("por tland"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Portland " checked>
Portland</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Portland " >
Portland</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("pra gue"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Prague" checked>
Prague</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Prague" >
Prague</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("que bec"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Quebec" checked>
Albany</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Quebec" >
Quebec</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("ral eighdurham"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="RaleighD urham" checked>
Raleigh-Durham</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="RaleighD urham" >
Raleigh Durham</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("sac ramento"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Sacramen to" checked>
Sacramento</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Sacramen to" >
Sacramento</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("san antonio"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="SanAnton io" checked>
San Antonio</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="San Antonio" >
San Antonio</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("san diego"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="SanDiego " checked>
San Diego</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="SanDiego " >
San Diego</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("san francisco"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="SanFranc isco" checked>
San Francisco</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="SanFranc isco" >
San Francisco</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("san juan"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="SanJuan" checked>
San Juan</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="SanJuan" >
San Juan</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("sea ttle"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Seattle" checked>
Seattle</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Seattle" >
Seattle</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("seo ul"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Seoul" checked>
Seoul</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Seoul" >
Seoul</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("sha nghai"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Shanghai " checked>
Shanghai</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Shanghai " >
Shanghai</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("sin gapore"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Singapor e" checked>
Singapore</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Singapor e" >
Singapore</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("StL ouis"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="StLouis" checked>
St. Louis</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="StLouis" >
St. Louis</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("syd ney"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Sydney" checked>
Sydney</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Sydney" >
Sydney</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("tok yo"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Tokyo" checked>
Tokyo</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Tokyo" >
Tokyo</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("tor onto"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Toronto" checked>
Toronto</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Toronto" >
Toronto</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("van couver"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Vancouve r" checked>
Vancouver</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Vancouve r" >
Vancouver</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td valign="top" class="bodytext ">&nbsp;</td>
<td valign="top" align="left">
<table>
<% if (cityName != null &&
cityName.equals IgnoreCase("war saw"))
{
%>
<tr>
<td width="146" align="left" class="bodytext "><input
type="radio" name="cityName" value="Warsaw" checked>
Warsaw</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Warsaw" >
Warsaw</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("was hington"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Washingt on" checked>
Washington D.C.</td>
</tr>
<% }
else
{ %>
<tr>
<td height="21" align="left" class="bodytext "><input
type="radio" name="cityName" value="Washingt on" >
Washington D.C.</td>
</tr>
<% } %>
</table></td>
<td valign="top" align="left"><t able>
<% if (cityName != null &&
cityName.equals IgnoreCase("alb any"))
{
%>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Albany" checked>
Albany</td>
</tr>
<% }
else
{ %>
<tr>
<td align="left" class="bodytext "><input type="radio"
name="cityName" value="Daily" >
Albany</td>
</tr>
<% } %>
</table></td>
</tr>
<tr>
<td class="bodytext "><input type="submit" name="SubmitBut ton"
id="SubmitButto n" value="Submit"> </td>
</tr>
<tr><td>&nbsp ;</td></tr>
<tr>
<td colspan=4
background="pt://images/plumtree/portal/custom/fh_images/rec_port_graphi cs/horiz_greyrule. gif">
<img
src="pt://images/plumtree/portal/custom/fh_images/rec_port_graphi cs/tr.gif"
width="1" height="1"></td>
</tr>
</table>
</form>
<jsp:include page="FHFooter. jsp"/>

</body>
</html>
Set User Prefs Page:
<%@ page language="java" import="com.plu mtree.remote.po rtlet.*"
contentType="te xt/html;charset=UT F-8" %>
<%
String path = request.getCont extPath();
String basePath =
request.getSche me()+"://"+request.getSe rverName()+":"+ request.getServ erPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePa th%>">

<title>My JSP 'setAdminPrefs. jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords " content="keywor d1,keyword2,key word3">
<meta http-equiv="descript ion" content="This is my page">

<!--
<link rel="stylesheet " type="text/css" href="styles.cs s">
-->
</head>

<body>
<%
//Get portlet context object
IPortletContext portletContext =
PortletContextF actory.createPo rtletContext(re quest,response) ;
IPortletRespons e portletResponse = portletContext. getResponse();

//Get user name from incoming form, and set it into the
portletResponse
String cityName = request.getPara meter("cityName ");
if (cityName == null)
{
System.out.prin tln("FHWeather: setUserPrefs: selected cityNameName
is null, set default StLouis");
cityName = "StLouis";
}

System.out.prin tln("FHWeather: setUserPrefs: cityName = " +
cityName);

IPortletRequest portletRequest = portletContext. getRequest();
portletResponse .setSettingValu e(SettingType.U ser, "cityName",
cityName);

System.out.prin tln("FHWeather: setUserPrefs: cityName = " +
portletRequest. getSettingValue (SettingType.Us er, "cityName") );

portletResponse .returnToPortal ();
%>
</body>
</html>
Thanks!

Jan 19 '06 #3
Br**********@ho tmail.com wrote:
Thanks for all of the help! Yeah i'm kind of lost on this. Yeah there
are two other pages that work with this one. This is for a portlet
within a portal. So it has to be set up kind of differently. There
are 3 pages. This is the display page. There is an edit page and then
a set user prefs page off of the edit page. I'll put those in here
too. Here's the changes I made according to what I think you said.

Display weather page:
<%@ page language="java" import="java.ut il.*, java.text.* " %>
<%@ page import="com.plu mtree.remote.po rtlet.*" %>
<%@ page import="com.plu mtree.remote.pr c.*" %>
<%
String path = request.getCont extPath();
String basePath =
request.getSche me()+"://"+request.getSe rverName()+":"+ request.getServ erPort()+path+"/";
%>
<% response.setHea der("Cache-Control", "max-age=3400"); %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePa th%>">

<title>Weathe r</title>

<!-- <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0"> -->
<meta http-equiv="keywords " content="keywor d1,keyword2,key word3">
<meta http-equiv="descript ion" content="This is my page">

<!--
<link rel="stylesheet " type="text/css" href="styles.cs s">
<link rel='stylesheet '
href='pt://images/plumtree/portal/custom/fh_styles/style.css'>
-->
<body>
<table>
<tr><td>
<script type="text/javascript">
var cityWeather = [
{ cityName: "austin",
weatherURL:
"http://voap.weather.co m/weather/oap/NLXX0002?templa te=GENXH&par=nu ll&unit=0&key=6 7d2b0264796112c e6d75944acad734 e"
},


A better idea is to use the city name as the key for the URLs:

var cityWeather = {
"austin" : "http://voap.weather.co m/weather/...",
"albany" : "http://voap.weather.co m/weather/...",
"melbourne" : "http://voap.weather.co m/weather/...",
"st lucia" : "http://voap.weather.co m/weather/..."
};
Presuming the city name was set elsewhere, you can do something like:

var cityKey = city.toLowerCas e();
if (cityKey in cityWeather) open (cityWeather[cityKey]);
No looping. The URL values "http://voap.weather.co m/weather/..." should
be replaced with the real values of course, and I'm guessing that you
have an 'open' function defined somewhere.
[...]
--
Rob
Jan 19 '06 #4
JRS: In article <Xn************ **********@207. 115.17.102>, dated Thu,
19 Jan 2006 19:26:53 remote, seen in news:comp.lang. javascript, Winston
Smith, American Patriot <Fr********@Oce ania.WhiteHouse .GOV> posted :

var cityWeather = [
{ cityName: "city1name" ,
weatherURL: "http://my.weather.url/for/city?number=1" },
{ cityName: "city2name" ,
weatherURL: "http://my.weather.url/for/city?number=2" },
{ cityName: "city13ame" ,
weatherURL: "http://my.weather.url/for/city?number=3" },
{ cityName: "city4name" ,
weatherURL: "http://my.weather.url/for/city?number=4" },
{ cityName: "city5name" ,
weatherURL: "http://my.weather.url/for/city?number=5" }
// as many 2-property objects as you have cities and weather
];

For a list of that sort of length, the above being a subset, one should
factor out most or all of the constant part, "http://my.weather.url/..."

Under the circumstances, shorter forms than cityName and WeatherURL
might be preferable; "city" and "URL" maybe.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jan 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2041
by: George Hester | last post by:
In a page I have when the user left-clicks the page a Input box for a form gets the focus. But if the user right-clicks the page the Input box is not getting the focus. I'd like the Input box to get the focus no matter where on the page the user clicks be it right-click or left-click. Right now there is no context menu when the user right-clicks. Do you think that's the problem? Any ideas how to get this right-click left-click Input box...
4
3854
by: JesusFreak | last post by:
From: us_traveller@yahoo.com (JesusFreak) Newsgroups: microsoft.public.scripting.jscript Subject: toolbar script problem NNTP-Posting-Host: 192.92.126.136 Recently, I downloaded the following beautiful script "http://javascript.internet.com/navigation/toolbar-menu.html". It works like a charm. I made my webpage in frames, where the nav-frame shows the menubar, so whenever I click a link in the menubar, it opens in the frame below. But...
2
1854
by: Axel Foley | last post by:
Hi Folks, i'm newbie at JS; but "learning by tweaking" is my middle name! Trying to set up a link partnership application on a client's site; got this script at "The Javascript Source", but it does not work for me. If anyone would be so kind as to comb it for apparent flaws, I would be greatly indebted! My <form> statement includes the following:... onSubmit="return
3
1801
by: P Wolpert | last post by:
This is my first post. I hope I don't sound stupid. I have a script conflict when I put two scripts on one page. Both scripts will work if I use one at a time but the menu button script will not work when I add the scrolling text script. One script, the menu button script, has an "Onload" command and the other one does not. From what I know, and that's not much, I need to put both scripts in the "Onload" command. I just don't know how to...
2
3914
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at http://home.pacific.net.sg/~jacksony ? (the drop down bar could not work at www.apchosting.net but can drop at home.pacific.net.sg. I suspect it is a server problem but was told it is not possible, therefore assuming it is a client script problem? the script works last time...
7
2539
by: fox | last post by:
Hi, Lacking javascript knowledge, I just realized why my project has a bug. I am using ASP to loop through a set of records while it creates URLs with a querystring that has a single value pair. This URL needs to open in a floating window if clicked. (this is for an administrator and so opening a small floater gives them more efficient access to the data that will be displayed). I now understand that because the ASP executes first, that...
2
3160
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button then the calender gone actually i want if i click outside off the calender then it should me removed ..How kan i do this ... Pls inform me as early as possible .. I am waiting for ur quick replay ...Here i attached the source code .... <!DOCTYPE...
3
2167
by: aashishn86 | last post by:
var weekend = ; var weekendColor = "#e0e0e0"; var fontface = "Verdana"; var fontsize = 1; var gNow = new Date(); var ggWinCal; isNav = (navigator.appName.indexOf("Netscape") != -1) ? true : false; isIE = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;
0
11011
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10725
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10352
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9503
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7072
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5735
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5931
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4142
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.