Solved

Advice on how to make sure end user knows they must select from a list

Posted on 2010-11-19
3
354 Views
Last Modified: 2012-05-10
Hi Experts,

I have an autocomplete function which brings back an array of iID and values.
The values are displayed to the user.
When selected the corresponding ID is stored in a hidden field.

I need to enforce the rule that if the user doesn't choose from the list (ie ID hasn't been set) then
they cannot carry on.  However, as the ID field is hidden, I am having trouble trying to come up with an elegant way of displaying this to the user.

Just after some advice on how you would tackle this problem!

Thanks
0
Comment
Question by:jagku
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 34172404
$("#formID").submit(function(e) {
     if( $("#listID").attr("selectedIndex") == 0 ) {
           e.preventDefault();
           alert("select something in the list!");
     }
});
0
 

Author Comment

by:jagku
ID: 34256258
Hi,

Apologies for the delay - I will take a look at this solution in the next fortnight and will come back to you.

Thanks
0
 

Author Closing Comment

by:jagku
ID: 34267086
Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
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…

828 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