View Single Post
Old 09-11-2008, 10:26 PM   PM User | #1
adi501
New Coder

 
Join Date: Jul 2008
Location: Falls Chuch, VA
Posts: 30
Thanks: 0
Thanked 1 Time in 1 Post
adi501 is an unknown quantity at this point
if statment problem

Hi the if statement in my code is not getting executed. It is moving to the else statement.

Please help me

Code:
Vector vRocks = cr.getRocks();
    for (int j=0; j<10; j++)
    {
      String sShowHide = j<(vRocks.size()+1)?"block":"none";
      String sRockName = "";
      int rockId = -1;

      if ( j<vRocks.size() )
      {
        BigRock br = (BigRock)vRocks.get(j);
        sRockName = br.getName();
        rockId    = br.getID();
      }

%>
<td class=formPromptSmall > <% if ( j==0 ) { %> Big Rocks: &nbsp; <% } %> </td>
<%
    
    if (sRockName == "physical" || sRockName == "social" || sRockName == "mental" || sRockName == "spiritual")
      {
%>
   <td class=formInput17> <div id="rock2_<%=i%>_<%=j%>" style="display: <%=sShowHide%>;">
     <input type=text name="rockname_<%=i%>_<%=j%>" class=textInput size=40 value="<%=sRockName%>" onFocus="javascript:ToggleSet('rock2_<%=i%>_<%=j+1%>','block');" disabled>
     <input type=hidden name="rockid_<%=i%>_<%=j%>" class=textInput value="<%=rockId%>">
    </div>
   </td>
  <%
      }
   else
     {
 %>
  <td class=formInput17> <div id="rock2_<%=i%>_<%=j%>" style="display: <%=sShowHide%>;"> 
    <input type=text name="rockname_<%=i%>_<%=j%>" class=textInput size=40 value="<%=sRockName%>" onFocus="javascript:ToggleSet('rock2_<%=i%>_<%=j+1%>','block');">
    <input type=hidden name="rockid_<%=i%>_<%=j%>" class=textInput value="<%=rockId%>">
   </div>
  </td>
</tr>
<%
        }
    }
The values i asssigned physical, mental , spiritual, social are the values of the sRockName which i found while debugging. Please let me know if anybody know the solution.


Thanks in Advance

Last edited by Aradon; 09-12-2008 at 11:31 AM..
adi501 is offline   Reply With Quote