Solved

How to auto-populate a list menu or textfield from a text file

Posted on 2012-03-19
6
223 Views
Last Modified: 2012-05-23
I have a submission page where a user enters their contact information. They also have to enter a specific case number for their submission. Issue is that some users enter case numbers that are not in the system.

I have created a way for real case numbers to automatically populate a text file (*.txt) on a daily basis. The main issue I have is how to force users to either enter or select the correct case number. There are roughly 250 case numbers and the format is the same for the case numbers.

Any suggestions along with direction (web pages/sites) are greatly appreciated. Can I use JavaScript? What about AJAX? The page is written in classic ASP but I'm willing to modify to accomplish my needs.

Thank you for your suggestions and direction.
0
Comment
Question by:arendt73
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 37738463
rather than asking user input in a text box, show the user a drop down below the text box (like auto-suggest) and force him to select from that drop down rather than accepting from textbox.

something like this
http://www.pengoworks.com/workshop/jquery/autocomplete.htm
0
 
LVL 20

Expert Comment

by:Proculopsis
ID: 37738684
<!--

Try jQuery AutoComplete

-->

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title> - jsFiddle demo</title>
 
  <script type='text/javascript' src='http://code.jquery.com/jquery-1.7.1.js'></script>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script>
 
<script type='text/javascript'>//<![CDATA[

jQuery(document).ready(function() {

    $("input#autocomplete").autocomplete({
        source: ["1000", "1001", "1002", "1003", "1004", "1005", "1006", "1007", "1008", "1009"]
    });


});
//]]>  

</script>

</head>
<body>

  <input id="autocomplete" />

 </body>
</html>
0
 

Author Comment

by:arendt73
ID: 37738708
Proculopsis, thank you. I'll give this is shot.  In the meantime, the autocomplete source will be a text file (info.txt). What would the code look like pointing to the text file?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Expert Comment

by:Proculopsis
ID: 37740872
For the source option you can use a url pointing to the data, you just need to make the file available on your server, at that location.
0
 

Accepted Solution

by:
arendt73 earned 0 total points
ID: 37745141
So instead of what you have currently now,

source: ["1000", "1001", "1002", "1003", "1004", "1005", "1006", "1007", "1008", "1009"]

It would look like this?

source: www.myserver.net/test/test.txt
0
 

Author Closing Comment

by:arendt73
ID: 38001430
Solution given acceptable.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Anyone familiar with PhotoSwipe? 3 41
javascript delete path 7 44
P3P validator , ASP, PHP ,Https and Http links 3 43
Adding Clickable Links to JQuery Data Items 24 54
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question