Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit rows based on column value

Status
Not open for further replies.

TheLazyPig

Programmer
Sep 26, 2019
95
PH
Hi!

I have a link that when I click it, only those who are status is Active will appear in the table.

b1_c0kay4.jpg


Code:
<form name = "BankAcctHistory">
#if($allowedviewlist)						
    <fieldset>
     <legend>Bank Account Information</legend>
      <table width="100%" cellpadding="1" cellspacing="2">
       <a href="javascript:saveBank()" id="btnSave" title="Save" disabled><img src = "images/Save.jpg" id="ImgSave" width="22" height="22" align="right"></a>
       <a href="javascript:editBank()" id="btnEdit" title="Edit"><img src = "images/Edit.jpg" id="ImgEdit" width="22" height="22" align="right" ></a>
       <a href="javascript:addBank('$!polno')" title="New"><img src = "images/Add.jpg" width="22" height="22" align="right" ></a>
       [b]<div>[<a href="javascript:viewActive()">view active accounts</a>]</div>[/b]
       <thead>
	<tr align="center">
	 <th width="10%">Account Status</th>
	 <th width="13%">Account No.</th>
         <th width="30%">Bank Info</th>
	 <th width="13%">Type</th>
	 <th width="13%">Date Added</th>
	 <th width="13%">Last Modified</th>
	 <th>Default</th>
	 <th></th>
	</tr>
       </thead>
    	 			
       <div id ="bnkact">
       </tbody>
	#foreach($ba in $bankaccntInfoList)   	
	  <tr align="center" [b]name="$!ba.get('ACCTSTATUS')"[/b]>			    		
	   <td width="10%">$!ba.get("ACCTSTATUS")</td>		  			
	   <td width="13%">$!ba.get("ACCTNO")</td>
	   <td width="30%">$!ba.get("BANKINFO")</td>
	   <td width="13%">$!ba.get("ACCTTYPE")</td>
	   <td width="13%">$!ba.get("DATE_ADDED")</td>
	   <td width="13%">$!ba.get("LAST_MODIFIED")</td>
	   #if("$!ba.get('PAYOUT')"=="10019911" && "$!ba.get('ENDDATE')" == "" && "$!ba.get('ACCTSTATUS')"=="Active")
	   <td><input type="radio" value="$!ba.get('BNKACCT_SEQNO')" id="$!ba.get('BNKACCT_SEQNO')" disabled="true" name="bnklist" checked></td>
	   #elseif("$!ba.get('ACCTSTATUS')"=="Invalid") 
	   <td>---</td>
	   #else
	   <td><input type="radio" value="$!ba.get('BNKACCT_SEQNO')" id="$!ba.get('BNKACCT_SEQNO')" disabled="true" name="bnklist"></td>
	   #end
	   #if("$!ba.get('ACCTSTATUS')"=="Invalid" && "$!ba.get('ENDDATE')" != "")	
	   <td>---</td>
	   #else
	   <td><a href="javascript:BankStat('$!ba.get('BNKACCT_SEQNO')')" name="bnkstat" title="click to invalidate account"><img src = "images/record_cancel.gif" id="ImgEdit" width="17" height="17" align="center" ></a></td>
	   #end	
	  </tr>
	</tbody>
	</div>		 			    
	#end
    </table>		    
  </fieldset>	    		    
 #end
</form>

javascript
Code:
function viewActive() {
   document.getElementsByName("Invalid").style="display:none";
}


Thanks in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top