View Single Post
Old 07-26-2004, 10:08 AM   #9 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,487
sde is on a distinguished road
thanks now it works great.

for the heck of it here is what i'm doing. i love the ternary operator.

i have a month array that fills a drop down text box. then i'm using the ternary operator to write the "selected" line.

Code:
for(int a=0;a<months.length;a++){
    out.println("<option value=\"" + months[a] + "\" "+ ((Integer.parseInt(months[a])==cal.get(cal.MONTH+1))?" selected":"") +">" + months[a] + "</option>");
  }
__________________
Mike
sde is offline   Reply With Quote