Results 1 to 4 of 4

Thread: Dropdown

  1. #1
    Junior Member
    Join Date
    Oct 2007
    Answers
    8

    Dropdown

    hi frnds,

    I have to implement a dropdown -without using ajax...in vs2.0 (vb.net-WEB APPLICATION)
    sorting should be done..
    ie,if u enter A it should show the words starts with A......

    If u enter AP ,it should show words start with AP etc..........
    and the dropdown data should be editable....

    so, how to implement this ........

    Thanks in advance


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Dropdown

    Kindly post what you have tried so far to solve this problem.


  3. #3
    Junior Member
    Join Date
    Oct 2007
    Answers
    8

    Re: Dropdown

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head><title>
        Untitled Page
    </title></head>
    <body>
    <form name="form1" method="post" action="example.aspx" id="form1">
    <div>
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE1MjM0NTI1NjgPZBYCAgMPZBYCAgEPEA9kFgIeCm9ua2V5cHJlc3MFMX" />
    </div>
    
    <script language="javascript" type="text/javascript">
    function KeySortDropDownList_onkeypress (dropdownlist,caseSensitive) {
      // check the keypressBuffer attribute is defined on the dropdownlist
      var undefined; 
      if (dropdownlist.keypressBuffer == undefined) { 
        dropdownlist.keypressBuffer = ''; 
      } 
      // get the key that was pressed 
      var key = String.fromCharCode(window.event.keyCode); 
      dropdownlist.keypressBuffer += key;
      if (!caseSensitive) {
        // convert buffer to lowercase
        dropdownlist.keypressBuffer = dropdownlist.keypressBuffer.toLowerCase();
      }
      // find if it is the start of any of the options 
      var optionsLength = dropdownlist.options.length; 
      for (var n=0; n < optionsLength; n++) { 
        var optionText = dropdownlist.options[n].text; 
        if (!caseSensitive) {
          optionText = optionText.toLowerCase();
        }
        if (optionText.indexOf(dropdownlist.keypressBuffer,0) == 0) { 
          dropdownlist.selectedIndex = n; 
          return false; // cancel the default behavior since 
                        // we have selected our own value 
        } 
      } 
      // reset initial key to be inline with default behavior 
      dropdownlist.keypressBuffer = key; 
      return true; // give default behavior 
    } 
    </script>
    <div>
    Find 'Brown" by typing 'b', 'r', 'o' when the dropdownlist has focus<br />
    <br />
    <select name="KeySortDropDownList1" id="KeySortDropDownList1" onkeypress="return KeySortDropDownList_onkeypress(this,false)" style="Z-INDEX: 101; LEFT: 448px; POSITION: absolute; TOP: 176px">
        <option selected="selected" value="Apple">Apple</option>
        <option value="Bozo">Bozo</option>
        <option value="Braun">Braun</option>
        <option value="Bream">Bream</option>
        <option value="Brown">Brown</option>
        <option value="Capitol">Capitol</option>
    
    </select>
    </div>
    </form>
    </body>
    </html>

    but i am not able to edit in dropdown

    Last edited by admin; 11-02-2007 at 06:30 AM.

  4. #4
    Junior Member
    Join Date
    Oct 2007
    Answers
    28

    Re: Dropdown

    hello,frm where ur using data in dropdown list?data base or direct coding.
    It is simple if u use data base .


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact