By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,480 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,480 IT Pros & Developers. It's quick & easy.

Advanced Javascript search within html

Daxthecon
P: 63
What I need.

-When there is nothing in the cell it needs to be red
-When there is something in the cell it should be green
-There should be a search input and it should bring up(on the next page after clicking search) the columns that apply to that search keyword only.

All this needs to be done in html and javascript. I've created the frame turned the excel to a csv and then made frames so tht it will look presentable. If I have to I will have to take the frames out. But I wanted to know if there was a way to do all this in just html and java. If there is please help me because it's been 2 days and I have nothing.
Jul 29 '08 #1
Share this Question
Share on Google+
7 Replies


acoder
Expert Mod 15k+
P: 16,027
Can you show some example HTML to begin with. Is it a table?

For the search, use the string methods for searching (link) once you have the values.
Jul 29 '08 #2

Daxthecon
P: 63
Unfortunately I didn't get this project done with the parameters and it was contracted out to someone who is more experienced then me in the web department. Well he decided to that it was to hard and sent an email to me to tell me that he's doing it in VB win form. I did it in 2 hours and sent it to the client. The conclusion we all came too is this is a massive project undertaking and wish I would have had more time to exerience it and see what I could have done with it.

Thank you for your attempt to help me but I have been busy for the last 2 weeks and haven't been able to get to many of my own posts.
Aug 5 '08 #3

acoder
Expert Mod 15k+
P: 16,027
No problem. Thanks for letting us know.

From the requirements in the first post, it shouldn't have been a very difficult task for an experienced programmer.
Aug 6 '08 #4

RamananKalirajan
100+
P: 607
Hi Dude,

[HTML]document.getElementById('myText').style.background Color='red'; [/HTML]

The above piece of code will help you in setting the background color of a textbox when it is null or not. But I don't know how to perform search within a page. I will try it out. The search work in the search box should search all the input elements within that page and show it in the next page. Is this your requirement.

pls: remove the unnecessary whitespace in the code

Regards
Ramanan Kalirajan.
Aug 7 '08 #5

acoder
Expert Mod 15k+
P: 16,027
But I don't know how to perform search within a page. I will try it out.
Since it's a search within the table, you can just use the String methods such as indexOf on each cell. If you want to search the whole page, you're better off using window.find (for Mozilla/Netscape) or, better still, the Range object.
Aug 7 '08 #6

RamananKalirajan
100+
P: 607
Since it's a search within the table, you can just use the String methods such as indexOf on each cell. If you want to search the whole page, you're better off using window.find (for Mozilla/Netscape) or, better still, the Range object.

Hi Acoder, thanks for your suggestion, I am aware of those methods and string.match() also but i haven't worked i.e created any working application to search a keyword in the whole page. that's what I have mentioned over there. Thanks for your suggestion.

Regards
Ramanan Kalirajan
Aug 7 '08 #7

acoder
Expert Mod 15k+
P: 16,027
I should clarify that the String search methods are only useful if there's only text in the cells. If there's HTML, you'll have to parse it to get the text only.
Aug 7 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.