Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. AJAX Databinded DropDown Option Property

AJAX Databinded DropDown Option Property

Scheduled Pinned Locked Moved ASP.NET
javascriptdatabasequestion
3 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cfer83
    wrote on last edited by
    #1

    I Have a dropdown which the user can add items to using AJAX but I need to prevent Duplicates. the dropdownlist.Options[index].value returns a number because of the way i'm databinding (i cannot change this). Is there a Javascript property for the Name That will get me the text in the option tags rather than the value?

    C 1 Reply Last reply
    0
    • C Cfer83

      I Have a dropdown which the user can add items to using AJAX but I need to prevent Duplicates. the dropdownlist.Options[index].value returns a number because of the way i'm databinding (i cannot change this). Is there a Javascript property for the Name That will get me the text in the option tags rather than the value?

      C Offline
      C Offline
      Cfer83
      wrote on last edited by
      #2

      The following function is called upon the onBlur event of the textbox control (txt). The following code does not work. Description of the function is: Search the ddl (an asp dropdown) for duplicates of the text in txt (asp textbox). Btn is an Asp.net Button that produces a postback and triggers the update panel in which only the ddl resides. function CheckCaller() { var txt = document.getElementById("txtAddCaller"); var btn = document.getElementById("Button1"); var ddl = document.form1.ddlCaller; var caller = trimAll(txt.value); var found = "false"; if (caller != "") { for (i=0; i

      C 1 Reply Last reply
      0
      • C Cfer83

        The following function is called upon the onBlur event of the textbox control (txt). The following code does not work. Description of the function is: Search the ddl (an asp dropdown) for duplicates of the text in txt (asp textbox). Btn is an Asp.net Button that produces a postback and triggers the update panel in which only the ddl resides. function CheckCaller() { var txt = document.getElementById("txtAddCaller"); var btn = document.getElementById("Button1"); var ddl = document.form1.ddlCaller; var caller = trimAll(txt.value); var found = "false"; if (caller != "") { for (i=0; i

        C Offline
        C Offline
        Cfer83
        wrote on last edited by
        #3

        I found a solution, thanks for looking.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups