www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > JavaScript

    JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...)

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 11-01-2009, 06:34 PM
    sher_amf sher_amf is offline
    Registered User
     
    Join Date: Jan 2008
    Posts: 64
    problem with several rows for fade effect

    okay i have a problem...i get the content of my rows from my database... the problem is when there is 4 rows... and i try to click on the 1st row... instead of it being deleted the 3rd row is deleted.. when i click on the 2nd row... the 4th row is delete...

    the moveicon.gif is the image for deleting the row.. there is no problem when i remove the javascript...but when i applied it i noticed the poblem
    Code:
      <table width="759" border="0">
        <tr>
          <td colspan="5"><span class="style8">Confirmed Request</span> </td>
        </tr>
        <tr>
          <td width="105" bgcolor="#408080"><span class="style5">Type</span></td>
          <td width="463" bgcolor="#408080"><span class="style5">Topic</span></td>
          <td width="108" bgcolor="#408080"><span class="style5">Date</span></td>
          <td width="25" bgcolor="#408080"><div align="center"></div></td>
          <td width="36" bgcolor="#408080"><div align="center"></div></td>
        </tr>
    <%@ page import="com.sun.rowset.CachedRowSetImpl;" %>
    <%
    	
    
    
    	int i = 0;
     	CachedRowSetImpl crset3 = new CachedRowSetImpl();
        crset3 = view.home2();
        
        	while (crset3.next())
    		{
    		
    	String day3 = crset3.getString("dep_date");
    		
    	  String[] monthcol2= day3.split("-");
          
           year = Integer.parseInt(monthcol2[0]); 
           month = Integer.parseInt(monthcol2[1]);
           day= Integer.parseInt(monthcol2[2]);
           m="";
          
          if(month==1)
          {
          m="Jan";
          }
          else if (month==2)
          {
          m="Feb";
          }
          else if (month==3)
          {
          m="March";
          }
          else if (month==4)
          {
          m="April";
          }
          else if (month==5)
          {
          m="May";
          }
          else if (month==6)
          {
          m="June";
          }
          else if (month==7)
          {
          m="July";
          }
          else if (month==8)
          {
          m="Aug";
          }
          else if (month==9)
          {
          m="Sept";
          }
          else if (month==10)
          {
          m="Oct";
          }
           else if (month==11)
          {
          m="Nov";
          }
          else if (month==12)
          {
          m="Dec";
          }
          
          
    		if(i==0)
    		{
    		%>
         <tr>
    <script src="images/jquery-latest.js"></script>
    
    <script type="text/javascript">
    <!--
    function confirmation1(){
            var answer = confirm("Do you want to move this to archives?")
    	if (answer){
    
    		$("#movieIcon").parents("tr").fadeOut("slow");		
    window.location = "http://localhost:8080/ICTPROJ/deployment/archiver.jsp?r=<%=crset3.getString("ref_num")%>&t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>";
    	}
    	else{
    	}
    
        }
    //-->
    </script>
    
          <td  scope="row"><fade1><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_type") %> </span>&nbsp;</div></fade1></td>
       	  <td  scope="row"><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_name")%></a>
    </span>&nbsp;</div></td>
           <td > <span class="style7">
           <% out.println(day);%>
           <% out.println("-");%>
           <% out.println(m);%>
           <% out.println("-");%>
           <% out.println(year);%> 
           </span></td>
           <td ><div align="center"><a href="http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>" onClick="chw=window.open('http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>','NewWindow','resizable=yes,scrollbars=yes,status=yes,width=640,height=500'); if (chw != null) chw.focus(); return false"><img src="../Chapters/images/reporticon.gif" border="0"></a></div></td>
           <td ><div align="center"><img id="movieIcon" src="images/moveicon.gif" width="29" height="29" border="0" onClick="confirmation1()"/></div></td>
        </tr>
    <%
    			i=1;
    		}
    		else
    		{
    %>
          <tr>
    <script type="text/javascript">
    <!--
    <!--
    function confirmation(){
            var answer = confirm("Do you want to move this to archives?")
    	if (answer){
    
    		$("#movieIcon1").parents("tr").fadeOut("slow");		
    window.location = "http://localhost:8080/ICTPROJ/deployment/archiver.jsp?r=<%=crset3.getString("ref_num")%>&t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>";
    	}
    	else{
    	}
    
        }
    //-->
    //-->
    </script>
    
             <td bgcolor="#CCCCCC" scope="row"><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_type") %></span>&nbsp;</div></td>
       	  <td bgcolor="#CCCCCC" scope="row"><div align="left" class="style22"><span class="style7"><%= crset3.getString("dep_name")%>
    </span>&nbsp;</div></td>
            <td bgcolor="#CCCCCC"> <span class="style7">
            <% out.println(day);%>
            <% out.println("-");%>
            <% out.println(m);%>
            <% out.println("-");%>
            <% out.println(year);%> 
            </span></td>
            <td bgcolor="#CCCCCC"> <a href="http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>" onClick="chw=window.open('http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>','NewWindow','resizable=no,scrollbars=yes,status=no,width=640,height=500'); if (chw != null) chw.focus(); return false"><div align="center"><img src="../Chapters/images/reporticon.gif" border="0"></div>
            </a></td>
            <td bgcolor="#CCCCCC" ><div align="center"><img id="movieIcon1" src="images/moveicon.gif" width="29" height="29" border="0" onClick="confirmation()"></div></td>
        </tr>
    <%	
    			i=0;
        	}
        }
    %>
      </table>
    Reply With Quote
      #2  
    Old 11-02-2009, 11:22 PM
    sher_amf sher_amf is offline
    Registered User
     
    Join Date: Jan 2008
    Posts: 64
    anyone?
    Reply With Quote
      #3  
    Old 11-04-2009, 10:04 AM
    ssystems ssystems is offline
    Registered User
     
    Join Date: Oct 2009
    Posts: 246
    First you are looping to build the table so use a class instead of the ID.

    Code:
    <img class="movieIcon" src="images/moveicon.gif" width="29" height="29" border="0" />
    Now bind the click event of the movieIcon class

    Code:
    $(document).ready(
        function (){
            $(".movieIcon").each().click(
                function(){
                     var answer = confirm("Do you want to move this to archives?")
    	if (answer){
    
    		$(this).parents("tr").fadeOut("slow");		
    window.location = "http://localhost:8080/ICTPROJ/deployment/archiver.jsp ..... blah blah blah";
                                 }
            );
        }
    );
    It would also be better to place your JS outside the table
    __________________
    Good Luck

    Santos Systems
    Reply With Quote
      #4  
    Old 11-05-2009, 02:06 AM
    sher_amf sher_amf is offline
    Registered User
     
    Join Date: Jan 2008
    Posts: 64
    is it something like this?
    i tried it but when i click the image nothing happens
    Code:
      <table width="759" border="0">
        <tr>
          <td colspan="5"><span class="style8">Confirmed Request</span> </td>
        </tr>
        <tr>
          <td width="105" bgcolor="#408080"><span class="style5">Type</span></td>
          <td width="463" bgcolor="#408080"><span class="style5">Topic</span></td>
          <td width="108" bgcolor="#408080"><span class="style5">Date</span></td>
          <td width="25" bgcolor="#408080"><div align="center"></div></td>
          <td width="36" bgcolor="#408080"><div align="center"></div></td>
        </tr>
    <%@ page import="com.sun.rowset.CachedRowSetImpl;" %>
    <%
    	
    
    
    	int i = 0;
     	CachedRowSetImpl crset3 = new CachedRowSetImpl();
        crset3 = view.home2();
        
        	while (crset3.next())
    		{
    		
    	String day3 = crset3.getString("dep_date");
    		
    	  String[] monthcol2= day3.split("-");
          
           year = Integer.parseInt(monthcol2[0]); 
           month = Integer.parseInt(monthcol2[1]);
           day= Integer.parseInt(monthcol2[2]);
           m="";
          
          if(month==1)
          {
          m="Jan";
          }
          else if (month==2)
          {
          m="Feb";
          }
          else if (month==3)
          {
          m="March";
          }
          else if (month==4)
          {
          m="April";
          }
          else if (month==5)
          {
          m="May";
          }
          else if (month==6)
          {
          m="June";
          }
          else if (month==7)
          {
          m="July";
          }
          else if (month==8)
          {
          m="Aug";
          }
          else if (month==9)
          {
          m="Sept";
          }
          else if (month==10)
          {
          m="Oct";
          }
           else if (month==11)
          {
          m="Nov";
          }
          else if (month==12)
          {
          m="Dec";
          }
          
          
    		if(i==0)
    		{
    		%>
    <script src="images/jquery-latest.js"></script>
    <script type="text/javascript">
    <!--
    $(document).ready(
        function (){
            $(".movieIcon").each().click(
                function(){
                     var answer = confirm("Do you want to move this to archives?")
    	if (answer){
    
    		$(this).parents("tr").fadeOut("slow");		
    window.location = "http://localhost:8080/ICTPROJ/deployment/archiver.jsp?r=<%=crset3.getString("ref_num")%>&t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>";
                                 }
            );
        }
    );
    //-->
    </script>
         <tr>
    
    
    
    
          <td  scope="row"><fade1><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_type") %> </span>&nbsp;</div></fade1></td>
       	  <td  scope="row"><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_name")%></a>
    </span>&nbsp;</div></td>
           <td > <span class="style7">
           <% out.println(day);%>
           <% out.println("-");%>
           <% out.println(m);%>
           <% out.println("-");%>
           <% out.println(year);%> 
           </span></td>
           <td ><div align="center"><a href="http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>" onClick="chw=window.open('http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>','NewWindow','resizable=yes,scrollbars=yes,status=yes,width=640,height=500'); if (chw != null) chw.focus(); return false"><img src="../Chapters/images/reporticon.gif" border="0"></a></div></td>            
           <td ><div align="center"><img class="movieIcon" src="images/moveicon.gif" width="29" height="29" border="0" /></div></td>
        </tr>
    
    <%
    			i=1;
    		}
    		else
    		{
    %>
          <tr>
    
             <td bgcolor="#CCCCCC" scope="row"><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_type") %></span>&nbsp;</div></td>
       	  <td bgcolor="#CCCCCC" scope="row"><div align="left" class="style22"><span class="style7"><%= crset3.getString("dep_name")%>
    </span>&nbsp;</div></td>
            <td bgcolor="#CCCCCC"> <span class="style7">
            <% out.println(day);%>
            <% out.println("-");%>
            <% out.println(m);%>
            <% out.println("-");%>
            <% out.println(year);%> 
            </span></td>
            <td bgcolor="#CCCCCC"> <a href="http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>" onClick="chw=window.open('http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>','NewWindow','resizable=no,scrollbars=yes,status=no,width=640,height=500'); if (chw != null) chw.focus(); return false"><div align="center"><img src="../Chapters/images/reporticon.gif" border="0"></div>
            </a></td> 
            <td bgcolor="#CCCCCC" ><div align="center"><a href="http://localhost:8080/ICTPROJ/deployment/archiver.jsp?r=<%=crset3.getString("ref_num")%>&t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>"><img id="movieIcon1" src="images/moveicon.gif" width="29" height="29" border="0" ></a></div></td>
        </tr>
    
    
    <%	
    			i=0;
        	}
        }
    %>
      </table>
    Reply With Quote
      #5  
    Old 11-06-2009, 02:50 AM
    sher_amf sher_amf is offline
    Registered User
     
    Join Date: Jan 2008
    Posts: 64
    hey can anyone help me with this? i just need to know how to call the class="moveicon" and what does it mean to bind the click event?

    Last edited by sher_amf; 11-06-2009 at 02:58 AM.
    Reply With Quote
      #6  
    Old 11-06-2009, 09:12 AM
    ssystems ssystems is offline
    Registered User
     
    Join Date: Oct 2009
    Posts: 246
    Thought I replied to this, I guess not.

    Code:
      <table width="759" border="0">
        <tr>
          <td colspan="5"><span class="style8">Confirmed Request</span> </td>
        </tr>
        <tr>
          <td width="105" bgcolor="#408080"><span class="style5">Type</span></td>
          <td width="463" bgcolor="#408080"><span class="style5">Topic</span></td>
          <td width="108" bgcolor="#408080"><span class="style5">Date</span></td>
          <td width="25" bgcolor="#408080"><div align="center"></div></td>
          <td width="36" bgcolor="#408080"><div align="center"></div></td>
        </tr>
    <%@ page import="com.sun.rowset.CachedRowSetImpl;" %>
    <%
    	
    
    
    	int i = 0;
     	CachedRowSetImpl crset3 = new CachedRowSetImpl();
        crset3 = view.home2();
        
        	while (crset3.next())
    		{
    		
    	String day3 = crset3.getString("dep_date");
    		
    	  String[] monthcol2= day3.split("-");
          
           year = Integer.parseInt(monthcol2[0]); 
           month = Integer.parseInt(monthcol2[1]);
           day= Integer.parseInt(monthcol2[2]);
           m="";
          
          if(month==1)
          {
          m="Jan";
          }
          else if (month==2)
          {
          m="Feb";
          }
          else if (month==3)
          {
          m="March";
          }
          else if (month==4)
          {
          m="April";
          }
          else if (month==5)
          {
          m="May";
          }
          else if (month==6)
          {
          m="June";
          }
          else if (month==7)
          {
          m="July";
          }
          else if (month==8)
          {
          m="Aug";
          }
          else if (month==9)
          {
          m="Sept";
          }
          else if (month==10)
          {
          m="Oct";
          }
           else if (month==11)
          {
          m="Nov";
          }
          else if (month==12)
          {
          m="Dec";
          }
          
          
    		if(i==0)
    		{
    		%>
    
         <tr>
    
    
    
    
          <td  scope="row"><fade1><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_type") %> </span>&nbsp;</div></fade1></td>
       	  <td  scope="row"><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_name")%></a>
    </span>&nbsp;</div></td>
           <td > <span class="style7">
           <% out.println(day);%>
           <% out.println("-");%>
           <% out.println(m);%>
           <% out.println("-");%>
           <% out.println(year);%> 
           </span></td>
           <td ><div align="center"><a href="http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>" onClick="chw=window.open('http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>','NewWindow','resizable=yes,scrollbars=yes,status=yes,width=640,height=500'); if (chw != null) chw.focus(); return false"><img src="../Chapters/images/reporticon.gif" border="0"></a></div></td>            
           <td ><div align="center"><img class="movieIcon" src="images/moveicon.gif" width="29" height="29" border="0" /></div></td>
        </tr>
    
    <%
    			i=1;
    		}
    		else
    		{
    %>
          <tr>
    
             <td bgcolor="#CCCCCC" scope="row"><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_type") %></span>&nbsp;</div></td>
       	  <td bgcolor="#CCCCCC" scope="row"><div align="left" class="style22"><span class="style7"><%= crset3.getString("dep_name")%>
    </span>&nbsp;</div></td>
            <td bgcolor="#CCCCCC"> <span class="style7">
            <% out.println(day);%>
            <% out.println("-");%>
            <% out.println(m);%>
            <% out.println("-");%>
            <% out.println(year);%> 
            </span></td>
            <td bgcolor="#CCCCCC"> <a href="http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>" onClick="chw=window.open('http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>','NewWindow','resizable=no,scrollbars=yes,status=no,width=640,height=500'); if (chw != null) chw.focus(); return false"><div align="center"><img src="../Chapters/images/reporticon.gif" border="0"></div>
            </a></td> 
            <td bgcolor="#CCCCCC" ><div align="center"><a href="http://localhost:8080/ICTPROJ/deployment/archiver.jsp?r=<%=crset3.getString("ref_num")%>&t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>"><img class="movieIcon" src="images/moveicon.gif" width="29" height="29" border="0" ></a></div></td>
        </tr>
    
    
    <%	
    			i=0;
        	}
        }
    %>
      </table>
      
      <script src="images/jquery-latest.js"></script>
    <script type="text/javascript">
    <!--
    $(document).ready(
        function (){
            $(".movieIcon").click(
                function(){
                     var answer = confirm("Do you want to move this to archives?")
    	if (answer){
    
    		$(this).parents("tr").fadeOut("slow");		
    window.location = "http://localhost:8080/ICTPROJ/deployment/archiver.jsp?r=<%=crset3.getString("ref_num")%>&t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>";
                                 }
            );
        }
    );
    //-->
    </script>
    __________________
    Good Luck

    Santos Systems
    Reply With Quote
      #7  
    Old 11-07-2009, 08:08 AM
    sher_amf sher_amf is offline
    Registered User
     
    Join Date: Jan 2008
    Posts: 64
    hey this is what i did...
    i tried using your code but i get an invalid cursor error hope you could help me with this.=) really appreciate your help! when i place the javascript outside the table the error occurs
    Code:
      <table width="759" border="0">
        <tr>
          <td colspan="5"><span class="style8">Confirmed Request</span> </td>
        </tr>
        <tr>
          <td width="105" bgcolor="#408080"><span class="style5">Type</span></td>
          <td width="463" bgcolor="#408080"><span class="style5">Topic</span></td>
          <td width="108" bgcolor="#408080"><span class="style5">Date</span></td>
          <td width="25" bgcolor="#408080"><div align="center"></div></td>
          <td width="36" bgcolor="#408080"><div align="center"></div></td>
        </tr>
    <%@ page import="com.sun.rowset.CachedRowSetImpl;" %>
    <%
    	
    
    
    	int i = 0;
     	CachedRowSetImpl crset3 = new CachedRowSetImpl();
        crset3 = view.home2();
        
        	while (crset3.next())
    		{
    		
    	String day3 = crset3.getString("dep_date");
    		
    	  String[] monthcol2= day3.split("-");
          
           year = Integer.parseInt(monthcol2[0]); 
           month = Integer.parseInt(monthcol2[1]);
           day= Integer.parseInt(monthcol2[2]);
           m="";
          
          if(month==1)
          {
          m="Jan";
          }
          else if (month==2)
          {
          m="Feb";
          }
          else if (month==3)
          {
          m="March";
          }
          else if (month==4)
          {
          m="April";
          }
          else if (month==5)
          {
          m="May";
          }
          else if (month==6)
          {
          m="June";
          }
          else if (month==7)
          {
          m="July";
          }
          else if (month==8)
          {
          m="Aug";
          }
          else if (month==9)
          {
          m="Sept";
          }
          else if (month==10)
          {
          m="Oct";
          }
           else if (month==11)
          {
          m="Nov";
          }
          else if (month==12)
          {
          m="Dec";
          }
          
          
    		if(i==0)
    		{
    		%>
    
         <tr>
    
    
    
    
          <td  scope="row"><fade1><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_type") %> </span>&nbsp;</div></fade1></td>
       	  <td  scope="row"><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_name")%></a>
    </span>&nbsp;</div></td>
           <td > <span class="style7">
           <% out.println(day);%>
           <% out.println("-");%>
           <% out.println(m);%>
           <% out.println("-");%>
           <% out.println(year);%> 
           </span></td>
           <td ><div align="center"><a href="http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>" onClick="chw=window.open('http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>','NewWindow','resizable=yes,scrollbars=yes,status=yes,width=640,height=500'); if (chw != null) chw.focus(); return false"><img src="../Chapters/images/reporticon.gif" border="0"></a></div></td>            
           <td ><div align="center"><img class="movieIcon" src="images/moveicon.gif" width="29" height="29" border="0" /></div></td>
             <script src="images/jquery-latest.js"></script>
    <script type="text/javascript">
    <!--
    $(document).ready(
        function (){
            $(".movieIcon").click(
                function(){
                     var answer = confirm("Do you want to move this to archives?")
    	if (answer){
    
    		$(this).parents("tr").fadeOut("slow");		
    window.location = "http://localhost:8080/ICTPROJ/deployment/archiver.jsp?r=<%=crset3.getString("ref_num")%>&t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>";
                                 }
            );
        }
    );
    //-->
    </script>
        </tr>
    
    <%
    			i=1;
    		}
    		else
    		{
    %>
          <tr>
    
             <td bgcolor="#CCCCCC" scope="row"><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_type") %></span>&nbsp;</div></td>
       	  <td bgcolor="#CCCCCC" scope="row"><div align="left" class="style22"><span class="style7"><%= crset3.getString("dep_name")%>
    </span>&nbsp;</div></td>
            <td bgcolor="#CCCCCC"> <span class="style7">
            <% out.println(day);%>
            <% out.println("-");%>
            <% out.println(m);%>
            <% out.println("-");%>
            <% out.println(year);%> 
            </span></td>
            <td bgcolor="#CCCCCC"> <a href="http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>" onClick="chw=window.open('http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>','NewWindow','resizable=no,scrollbars=yes,status=no,width=640,height=500'); if (chw != null) chw.focus(); return false"><div align="center"><img src="../Chapters/images/reporticon.gif" border="0"></div>
            </a></td> 
            <td bgcolor="#CCCCCC" ><div align="center"><a href="http://localhost:8080/ICTPROJ/deployment/archiver.jsp?r=<%=crset3.getString("ref_num")%>&t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>"><img class="movieIcon" src="images/moveicon.gif" width="29" height="29" border="0" ></a></div></td>
        </tr>
    
    
    <%	
    			i=0;
        	}
        }
    %>
      </table>
    Reply With Quote
      #8  
    Old 11-07-2009, 11:00 AM
    ssystems ssystems is offline
    Registered User
     
    Join Date: Oct 2009
    Posts: 246
    Yep I forgot about your loop. On the same position where I placed the js codes try this

    Code:
    $(document).ready(
        function (){
            $(".movieIcon").click(
                function(){
                    var answer = confirm("Do you want to move this to archives?")
    				if (answer){
    					var target = #(this).parents("a").attr("href");
    					$(this).parents("tr").fadeOut("slow");		
    					window.location = target;
    				}
    			}
    		);
    	}
    );
    __________________
    Good Luck

    Santos Systems
    Reply With Quote
      #9  
    Old 11-07-2009, 06:21 PM
    sher_amf sher_amf is offline
    Registered User
     
    Join Date: Jan 2008
    Posts: 64
    unfortunately still doesn't work and the problem is when i click the movicon still nothing happens... here is the final code based on what you said
    Code:
    <table width="759" border="0">
        <tr>
          <td colspan="5"><span class="style8">Confirmed Request</span> </td>
        </tr>
        <tr>
          <td width="105" bgcolor="#408080"><span class="style5">Type</span></td>
          <td width="463" bgcolor="#408080"><span class="style5">Topic</span></td>
          <td width="108" bgcolor="#408080"><span class="style5">Date</span></td>
          <td width="25" bgcolor="#408080"><div align="center"></div></td>
          <td width="36" bgcolor="#408080"><div align="center"></div></td>
        </tr>
    <%@ page import="com.sun.rowset.CachedRowSetImpl;" %>
    <%
    	
    
    
    	int i = 0;
     	CachedRowSetImpl crset3 = new CachedRowSetImpl();
        crset3 = view.home2();
        
        	while (crset3.next())
    		{
    		
    	String day3 = crset3.getString("dep_date");
    		
    	  String[] monthcol2= day3.split("-");
          
           year = Integer.parseInt(monthcol2[0]); 
           month = Integer.parseInt(monthcol2[1]);
           day= Integer.parseInt(monthcol2[2]);
           m="";
          
          if(month==1)
          {
          m="Jan";
          }
          else if (month==2)
          {
          m="Feb";
          }
          else if (month==3)
          {
          m="March";
          }
          else if (month==4)
          {
          m="April";
          }
          else if (month==5)
          {
          m="May";
          }
          else if (month==6)
          {
          m="June";
          }
          else if (month==7)
          {
          m="July";
          }
          else if (month==8)
          {
          m="Aug";
          }
          else if (month==9)
          {
          m="Sept";
          }
          else if (month==10)
          {
          m="Oct";
          }
           else if (month==11)
          {
          m="Nov";
          }
          else if (month==12)
          {
          m="Dec";
          }
          
          
    		if(i==0)
    		{
    		%>
    
         <tr>
    
    
    
    
          <td  scope="row"><fade1><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_type") %> </span>&nbsp;</div></fade1></td>
       	  <td  scope="row"><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_name")%></a>
    </span>&nbsp;</div></td>
           <td > <span class="style7">
           <% out.println(day);%>
           <% out.println("-");%>
           <% out.println(m);%>
           <% out.println("-");%>
           <% out.println(year);%> 
           </span></td>
           <td ><div align="center"><a href="http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>" onClick="chw=window.open('http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>','NewWindow','resizable=yes,scrollbars=yes,status=yes,width=640,height=500'); if (chw != null) chw.focus(); return false"><img src="../Chapters/images/reporticon.gif" border="0"></a></div></td>            
           <td ><div align="center"><img class="movieIcon" src="images/moveicon.gif" width="29" height="29" border="0" /></div></td>
        </tr>
    
    <%
    			i=1;
    		}
    		else
    		{
    %>
          <tr>
    
             <td bgcolor="#CCCCCC" scope="row"><div align="left" class="style22"><span class="style7"> <%= crset3.getString("dep_type") %></span>&nbsp;</div></td>
       	  <td bgcolor="#CCCCCC" scope="row"><div align="left" class="style22"><span class="style7"><%= crset3.getString("dep_name")%>
    </span>&nbsp;</div></td>
            <td bgcolor="#CCCCCC"> <span class="style7">
            <% out.println(day);%>
            <% out.println("-");%>
            <% out.println(m);%>
            <% out.println("-");%>
            <% out.println(year);%> 
            </span></td>
            <td bgcolor="#CCCCCC"> <a href="http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>" onClick="chw=window.open('http://localhost:8080/ICTPROJ/deployment/reports_2.jsp?t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>','NewWindow','resizable=no,scrollbars=yes,status=no,width=640,height=500'); if (chw != null) chw.focus(); return false"><div align="center"><img src="../Chapters/images/reporticon.gif" border="0"></div>
            </a></td> 
            <td bgcolor="#CCCCCC" ><div align="center"><a href="http://localhost:8080/ICTPROJ/deployment/archiver.jsp?r=<%=crset3.getString("ref_num")%>&t=<%=crset3.getString("dep_time")%>&l=<%= crset3.getString("dep_location") %>&d=<%= crset3.getString("dep_date") %>"><img class="movieIcon" src="images/moveicon.gif" width="29" height="29" border="0" ></a></div></td>
        </tr>
    
    
    <%	
    			i=0;
        	}
        }
    %>
      </table>
      
    <script src="images/jquery-latest.js"></script>
    <script type="text/javascript">
    <!--
    $(document).ready(
        function (){
            $(".movieIcon").click(
                function(){
                    var answer = confirm("Do you want to move this to archives?")
    				if (answer){
    					var target = #(this).parents("a").attr("href");
    					$(this).parents("tr").fadeOut("slow");		
    					window.location = target;
    				}
    			}
    		);
    	}
    );
    //-->
    </script>
    Reply With Quote
      #10  
    Old 11-07-2009, 08:02 PM
    ssystems ssystems is offline
    Registered User
     
    Join Date: Oct 2009
    Posts: 246
    Try this first

    Code:
    <script src="images/jquery-latest.js"></script>
    <script type="text/javascript">
    
    $(document).ready(
        function (){
            $(".movieIcon").click(
                function(){
                     var target = $(this).parents("a").attr("href");
    		alert(target);
    			}
    		);
    	}
    );
    if that worked change the previous post to

    Code:
    <script src="images/jquery-latest.js"></script>
    <script type="text/javascript">
    <!--
    $(document).ready(
        function (){
            $(".movieIcon").click(
                function(){
                    var answer = confirm("Do you want to move this to archives?")
    				if (answer){
    					var target = $(this).parents("a").attr("href");
    					$(this).parents("tr").fadeOut("slow");		
    					window.location = target;
    				}
    			}
    		);
    	}
    );
    __________________
    Good Luck

    Santos Systems

    Last edited by ssystems; 11-07-2009 at 08:04 PM.
    Reply With Quote
      #11  
    Old 11-07-2009, 09:56 PM
    sher_amf sher_amf is offline
    Registered User
     
    Join Date: Jan 2008
    Posts: 64
    it works but the problem is that when i click cancel it still redirects the page.. it should be that when my cancel the alert is noting happens
    Reply With Quote
      #12  
    Old 11-07-2009, 10:24 PM
    ssystems ssystems is offline
    Registered User
     
    Join Date: Oct 2009
    Posts: 246
    O that's what you meant. Just return false when they chose cancel

    Code:
    <script src="images/jquery-latest.js"></script>
    <script type="text/javascript">
    <!--
    $(document).ready(
        function (){
            $(".movieIcon").click(
                function(){
                    var answer = confirm("Do you want to move this to archives?")
    				if (answer){
    					var target = $(this).parents("a").attr("href");
    					$(this).parents("tr").fadeOut("slow");		
    					window.location = target;
    				}
                                    else{
                                           return false;
                                    }
    			}
    		);
    	}
    );
    __________________
    Good Luck

    Santos Systems
    Reply With Quote
      #13  
    Old 11-07-2009, 10:48 PM
    sher_amf sher_amf is offline
    Registered User
     
    Join Date: Jan 2008
    Posts: 64
    thank you very much!!
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 05:21 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.