JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 30th, 2013, 05:40 PM
ccxc007 ccxc007 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 2 ccxc007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 9 m 20 sec
Reputation Power: 0
Other - Search Box, Reference Excel file, auto-populate, is this possible?

I have something like this (below); however, it is really not what I want.
I would like to be able to search an excel file (or whatever formate it would need to be in to make this work) and as I type, it would search and auto-finish based on the words in the columns.
EXAMPLE: if column A has car models, as I type "Ford" it would come up. And if column B has type of car, as I type "Cobalt" it would auto populate that.
I am brand new to this form and I am slightly new to JAVA.
I appreciate any input you could give me,
Scott



<input type="text" name="searchPhrase" />
<a href="javascript: searchExcel();">Search</a>
<div id="results"></div>
function searchExcel()
{
var searchPhrase = document.getElementById('searchPhrase').value;
var Worksheet = 'C://EXAMPLE.XLS';
var Excel = new ActiveXObject('Excel.Application');

Excel.Visible = false;
var Excel_file = Excel.Workbooks.Open(Worksheet, null, true, null,
"abc", null, true, null, null, false, false, null, null, null);

var range = Excel_file.ActiveSheet.Range('A:A');
var jsRangeArray = new VBArray(range.Value).toArray();

var found = false;
for(cells in jsRangeArray)
{
if(jsRangeArray[cells] == searchPhrase)
{
document.getElementById("results").innerHTML = "Found";
found = true;
}
}

if(found == false)
{
document.getElementById("results").innerHTML = "Not Found";
}

Excel.ActiveWorkbook.Close(true);
Excel.Application.Quit();
Excel = null;
}

Reply With Quote
  #2  
Old March 30th, 2013, 06:05 PM
ccxc007 ccxc007 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 2 ccxc007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 9 m 20 sec
Reputation Power: 0
It seems like it might be easier for me to put the excel file into a different format. Is this correct?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Other - Search Box, Reference Excel file, auto-populate, is this possible?


Developer Shed Advertisers and Affiliates


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap