Click here to Skip to main content
15,896,359 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: inserting the id of data in the second dropdown menu(this second drop down menu depends on the first drop down menu) Pin
nahelna31-Jul-08 1:37
nahelna31-Jul-08 1:37 
GeneralRe: second drop down menu depends on the first drop down menu Pin
nahelna31-Jul-08 1:51
nahelna31-Jul-08 1:51 
Questionremote script please help....... Pin
mohd faiz30-Jul-08 2:10
mohd faiz30-Jul-08 2:10 
AnswerRe: remote script please help....... Pin
Shog930-Jul-08 4:07
sitebuilderShog930-Jul-08 4:07 
QuestionJquery Pin
prnkrish29-Jul-08 12:26
prnkrish29-Jul-08 12:26 
AnswerRe: Jquery Pin
Shog929-Jul-08 13:01
sitebuilderShog929-Jul-08 13:01 
GeneralRe: Jquery Pin
prnkrish30-Jul-08 7:54
prnkrish30-Jul-08 7:54 
GeneralRe: Jquery Pin
Shog930-Jul-08 8:18
sitebuilderShog930-Jul-08 8:18 
Well, obviously i don't know how you're obtaining IDs or associating names with them, but you could try something like this:
// 
// adds new method to jQuery, only operates on select lists, adds option with specified text, optional value
//
$.fn.addOption = function(optText, optVal)
{
   this.filter("select").each(function()
   {
     var opt = new Option(optText, optVal);
     this.options.add(opt);
   });
}

var mapIdToName = 
{
   1 : "name1",
   2 : "name2",
   3 : "name3",
   4 : "George",
   5 : "name5"
};

//
// attaches to blur event of input field with id of textentry, 
// causes it to add text to select list with id of dropdown (if text is non-empty / non-whitespace)
//
$(function()
{
   $("#textentry").blur(function() 
   {
      var optionVal = $.trim(this.value);
      var optionText = mapIdToName[optionVal];
      this.value = '';
      if ( optionText )
         $("#dropdown").addOption(optionText, optionVal);
   });
});

Something just occurred to me: are you trying to implement an auto-complete / filter system? If so, you should probably check out this: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/[^] (soon to be a part of the official jquery.ui suite).


Citizen 20.1.01
'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'

GeneralRe: Jquery Pin
prnkrish30-Jul-08 9:00
prnkrish30-Jul-08 9:00 
GeneralRe: Jquery Pin
Shog930-Jul-08 9:23
sitebuilderShog930-Jul-08 9:23 
AnswerWeb development using FineReport Pin
zxn622829-Jul-08 8:56
zxn622829-Jul-08 8:56 
GeneralRe: Web development using FineReport Pin
Paul Conrad29-Jul-08 10:05
professionalPaul Conrad29-Jul-08 10:05 
GeneralRe: Web development using FineReport Pin
Shog929-Jul-08 10:13
sitebuilderShog929-Jul-08 10:13 
GeneralRe: Web development using FineReport Pin
led mike29-Jul-08 10:24
led mike29-Jul-08 10:24 
GeneralRe: Web development using FineReport Pin
zxn622830-Jul-08 9:45
zxn622830-Jul-08 9:45 
GeneralRe: Web development using FineReport Pin
zxn622830-Jul-08 9:50
zxn622830-Jul-08 9:50 
GeneralRe: Web development using FineReport Pin
Shog930-Jul-08 9:56
sitebuilderShog930-Jul-08 9:56 
GeneralCSS Layout for Input Controls Pin
Brady Kelly28-Jul-08 22:36
Brady Kelly28-Jul-08 22:36 
GeneralRe: CSS Layout for Input Controls Pin
Shog929-Jul-08 4:43
sitebuilderShog929-Jul-08 4:43 
GeneralRe: CSS Layout for Input Controls Pin
Brady Kelly29-Jul-08 5:16
Brady Kelly29-Jul-08 5:16 
GeneralRe: CSS Layout for Input Controls Pin
Shog929-Jul-08 10:10
sitebuilderShog929-Jul-08 10:10 
Questiongetting customers Pin
K Manisha28-Jul-08 17:59
K Manisha28-Jul-08 17:59 
AnswerRe: getting customers Pin
Vasudevan Deepak Kumar28-Jul-08 18:30
Vasudevan Deepak Kumar28-Jul-08 18:30 
Questionsuggession needed Pin
Harikrk28-Jul-08 16:30
Harikrk28-Jul-08 16:30 
AnswerRe: suggession needed Pin
Paul Conrad28-Jul-08 18:43
professionalPaul Conrad28-Jul-08 18:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.