Solved

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

Posted on 2012-03-19
6
219 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
  • 3
  • 2
6 Comments
 
LVL 40

Expert Comment

by:gurvinder372
Comment Utility
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
Comment Utility
<!--

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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 20

Expert Comment

by:Proculopsis
Comment Utility
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
Comment Utility
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
Comment Utility
Solution given acceptable.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
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, …
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now