Click here to Skip to main content
15,867,985 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: how to read .zip file in php Pin
udch12-Apr-10 5:12
udch12-Apr-10 5:12 
QuestionWeb interface Pin
josephong8-Apr-10 21:10
josephong8-Apr-10 21:10 
QuestionVisual Studio Solution In GCC Pin
darc koder6-Apr-10 7:10
darc koder6-Apr-10 7:10 
AnswerRe: Visual Studio Solution In GCC Pin
N a v a n e e t h6-Apr-10 15:56
N a v a n e e t h6-Apr-10 15:56 
QuestionDatabase search function in php Pin
offroaderdan6-Apr-10 4:24
offroaderdan6-Apr-10 4:24 
AnswerRe: Database search function in php Pin
cjoki6-Apr-10 6:17
cjoki6-Apr-10 6:17 
AnswerRe: Database search function in php Pin
Eddy Vluggen7-Apr-10 3:11
professionalEddy Vluggen7-Apr-10 3:11 
AnswerRe: Database search function in php Pin
enhzflep7-Apr-10 4:35
enhzflep7-Apr-10 4:35 
I note that you'd like the other numbers to disappear/hide - implying that they're already visible on the page. If that's the case, then why use php for that I wonder? Surely the approach to use is one of JavaScript?

I'd achieve what I understand as the aim with code resembling the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.style1 {
	font-size: 24px;
	font-weight: bold;
}
.hiddenTxt {
	display: none;
}
</style>
<script type="text/javascript">
function byId(e){return document.getElementById(e)}
function doFind()
{
	var table = byId("table1");
	var row , x, y
	var searchStr
	
	searchStr = byId("serialInput").value
	for (y=0; y<5; y++)
	{
		row = table.rows[y]
		for (x=0; x<5; x++)
		{
			if (row.cells[x].innerHTML != searchStr)
				row.cells[x].className = "hiddenTxt" 
			else
				row.cells[x].className = ""
		}
	}
}

function doReset()
{
	var table = byId("table1"), row , cell, x, y
	
	for (y=0; y<5; y++)
	{
		row = table.rows[y]
		for (x=0; x<5; x++)
		{
			cell = row.cells[x]
			cell.className = ""
		}
	}
}
</script>
</head>

<body>
<table width="300" border="2" bordercolor="#333333" id="table1">
  <caption>
    <span class="style1">Serial Numbers</span>
  </caption>
  <tr>
    <td>1234</td>
    <td>5678</td>
    <td>9012</td>
    <td>3456</td>
    <td>8901</td>
  </tr>
  <tr>
    <td>abcd</td>
    <td>efgh</td>
    <td>ijkl</td>
    <td>mnop</td>
    <td>qrst</td>
  </tr>
  <tr>
    <td>uvwx</td>
    <td>yz</td>
    <td>a</td>
    <td>b</td>
    <td>c</td>
  </tr>
  <tr>
    <td>d</td>
    <td>e</td>
    <td>f</td>
    <td>g</td>
    <td>h</td>
  </tr>
  <tr>
    <td>i</td>
    <td>j</td>
    <td>k</td>
    <td>l</td>
    <td>m</td>
  </tr>
</table>
<p>Search for
  <input type="text" id="serialInput" size="20" maxlength="4" value="1234"/>
  <input type="button" id="findBtn" value="Find" onclick="doFind()"/>
  <input type="button" id="findBtn2" value="Reset" onclick="doReset()"/>
</p>
</body>
</html>

Questionsimple web crawler Pin
gouravrinks3-Apr-10 4:42
gouravrinks3-Apr-10 4:42 
AnswerRe: simple web crawler Pin
Moak24-Apr-10 2:08
Moak24-Apr-10 2:08 
Questioncopy web page Pin
udch1-Apr-10 22:47
udch1-Apr-10 22:47 
AnswerRe: copy web page Pin
Graham Breach1-Apr-10 23:18
Graham Breach1-Apr-10 23:18 
GeneralRe: copy web page Pin
udch2-Apr-10 22:24
udch2-Apr-10 22:24 
GeneralRe: copy web page Pin
Graham Breach3-Apr-10 2:34
Graham Breach3-Apr-10 2:34 
GeneralRe: copy web page Pin
udch4-Apr-10 1:33
udch4-Apr-10 1:33 
QuestionBest way to send/read gmail? Pin
RachelSo30-Mar-10 15:50
RachelSo30-Mar-10 15:50 
AnswerRe: Best way to send/read gmail? Pin
markkuk31-Mar-10 1:49
markkuk31-Mar-10 1:49 
AnswerRe: Best way to send/read gmail? Pin
RachelSo31-Mar-10 11:08
RachelSo31-Mar-10 11:08 
QuestionPHP Install Pin
DinoRondelly30-Mar-10 6:59
DinoRondelly30-Mar-10 6:59 
AnswerRe: PHP Install Pin
Jayapal Chandran5-Apr-10 7:18
Jayapal Chandran5-Apr-10 7:18 
AnswerRe: PHP Install Pin
Jayapal Chandran5-Apr-10 7:19
Jayapal Chandran5-Apr-10 7:19 
AnswerRe: PHP Install Pin
cjoki6-Apr-10 6:12
cjoki6-Apr-10 6:12 
QuestionExporting to PDF using PHP code Pin
sarang_k29-Mar-10 18:23
sarang_k29-Mar-10 18:23 
AnswerRe: Exporting to PDF using PHP code Pin
Graham Breach30-Mar-10 0:05
Graham Breach30-Mar-10 0:05 
AnswerRe: Exporting to PDF using PHP code Pin
Luc Pattyn30-Mar-10 1:03
sitebuilderLuc Pattyn30-Mar-10 1:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.