?
Solved

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

Posted on 2012-03-19
6
Medium Priority
?
226 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:Gurvinder Pal Singh
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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…
Suggested Courses

762 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