473,394 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Search a keyword but but only on one kind of tag

Hello, so first of all i would say you that i'm french so sorry for my
sitakes.
I made an application in XML/XSL which presents the people of my
company

Let me show the structure of my form :

<tr onMouseOver="this.bgColor='#ADC8E9';"
onMouseOut="this.bgColor='#F5F5F5';">
<td width="14.28%">Name1</td>
<td width="14.28%">FirstName1</td>
<td width="14.28%">Phone1</td>
</tr>
<tr onMouseOver="this.bgColor='#ADC8E9';"
onMouseOut="this.bgColor='#F5F5F5';">
<td width="14.28%">Name2</td>
<td width="14.28%">FirstName2</td>
<td width="14.28%">Phone2</td>
</tr>
<tr onMouseOver="this.bgColor='#ADC8E9';"
onMouseOut="this.bgColor='#F5F5F5';">
<td width="14.28%">Name3</td>
<td width="14.28%">FirstName3</td>
<td width="14.28%">Phone3</td>
</tr>

etc...

And in this form i want to allow user to search on the column which is
sorted. For example, if the user sort the "Name" column, they will
search on this one.

==> THERE IS MY QUESTION : HOW CAN I DO THAT ???????

i am looking for "getElementById" or getElementsById but i have many
problems !!
we can imagine that all the td for name get the same "id" or "name"
but how can i get all this "td" ???

I hope you understand my problem

thank you for your answers,

Marc
Jul 20 '05 #1
1 1096
In article <b6**************************@posting.google.com >,
ma************@yahoo.fr (Marc Pichouron) writes:

<--snip-->
<tr onMouseOver="this.bgColor='#ADC8E9';"
onMouseOut="this.bgColor='#F5F5F5';">
<td width="14.28%">Name3</td>
<td width="14.28%">FirstName3</td>
<td width="14.28%">Phone3</td>
</tr>

etc...

And in this form i want to allow user to search on the column which is
sorted. For example, if the user sort the "Name" column, they will
search on this one.

==> THERE IS MY QUESTION : HOW CAN I DO THAT ???????

i am looking for "getElementById" or getElementsById but i have many
problems !!
we can imagine that all the td for name get the same "id" or "name"
but how can i get all this "td" ???

I hope you understand my problem

thank you for your answers,


give each td tag a unique id, starting with the category. The above quoted
would become:

<td width="14.28%" id="name_3">Name3</td>
<td width="14.28%" id="firstName_3">FirstName3</td>
<td width="14.28%" id="phone_3">Phone3</td>
This script:

function showThem(id_substring){
myTDTags = document.getElementsByTagName("TD")
for (i=0;i<myTDTags.length;i++)
{
if ((myTDTags[i].id.substring(0,id_substring.length)) == id_substring)
{
myTDTags[i].style.background = 'red'
}
else
{
myTDTags[i].style.background = 'white'
}
}
}

Using this HTML:

<table>
<tr>
<td id="name_1">Name 1</td>
<td id="firstName_1">First Name 1</td>
<td id="phone_1">Phone 1</td>
</tr>
<tr>
<td id="name_2">Name 2</td>
<td id="firstName_2">First Name 2</td>
<td id="phone_2">Phone 2</td>
</tr>
<tr>
<td id="name_3">Name 3</td>
<td id="firstName_3">First Name 3</td>
<td id="phone_3">Phone 3</td>
</tr>
</table>
<button onclick="showThem('name')">Color the Name</button>
<button onclick="showThem('firstName')">Color the First Name</button>
<button onclick="showThem('phone')">Color the Phone</button>

Works in IE6.0, Mozilla 1.4 and Opera 7. Modify it if need be. If not, post a
sample URL to look at.
--
Randy
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Phil Powell | last post by:
The table already has a fulltext index and from there I can use the MySQL fulltext search query to get results as well as the relevancy score. The problem I have is that MySQL has a default...
2
by: David Lozzi | last post by:
Howdy, I am doing a simple keyword search in my SQL database from my ASP.NET w/ VB application. Currently, I am using a PROC and within the PROC I am doing something like so: SELECT * FROM...
3
by: Chung Leong | last post by:
Here's the rest of the tutorial I started earlier: Aside from text within a document, Indexing Service let you search on meta information stored in the files. For example, MusicArtist and...
19
by: bb nicole | last post by:
Below is my search engine for job portal which jobseeker can find the job through quick search. But it cant work... Is it mysql query got problem?? Thanx.. Interface <html> <head> <title>UMS...
5
by: mforema | last post by:
Hi Everyone, I want to search records by typing in multiple keywords. I currently have a search form. It has a combo box, text box, Search command button, and a subform. The combo box lists the...
2
by: rlemusic | last post by:
Hi everybody, I’m creating a database in Access (I believe it’s 2000) to catalogue items in the archives of a small museum. I’m a total n00b as far as using Access goes, but by looking at some...
3
by: Redbeard | last post by:
Hi All this is my first time post, be gentle. I am looking at creating a keyword search that searches multiple fields in a Form and then filters records that match the keyword. The Form...
5
by: kanley | last post by:
I have a main table with a text description field. In this field, its populated with a string of data. I need to identify from this string of data the name of the vendor using some keywords. I...
1
by: prasath03 | last post by:
Hi Gurus, I am doing one website project that project contains one search module. In that search page i have entered the keyword to search. If i want to search the keyword with "any keyword" or...
12
by: iahamed | last post by:
Hi Everyone, I got two parts of my advance search to work, I am running out of Logic to connect the third. My mind is in swing! Pleaseeeeeeeee Help me. I have 3 Fiels to search, the First two...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.