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. General Programming
  3. .NET (Core and Framework)
  4. How to pass multiple parameters in autocomplete script

How to pass multiple parameters in autocomplete script

Scheduled Pinned Locked Moved .NET (Core and Framework)
javascripttoolstutorial
2 Posts 2 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.
  • R Offline
    R Offline
    Robymon
    wrote on last edited by
    #1

    I want to pass multiple parameters ( ID and Name ) to the autocomplete script. It works if i put only one parameter but not working with two parameters. This is not working

    <script type="text/javascript">function BindEvents() {
    $(document).ready(function () {
    $("#<%=txtID.ClientID%>")+$("#<%=txtName.ClientID%>").autocomplete('../../Common_Search/Employee.ashx');
    });
    }

    </script>

    This is working

    <script type="text/javascript">
    function BindEvents() {
    $(document).ready(function () {
    $("#<%=txtID.ClientID%>").autocomplete('../../Common_Search/Employee.ashx');
    });
    }
    </script>

    P 1 Reply Last reply
    0
    • R Robymon

      I want to pass multiple parameters ( ID and Name ) to the autocomplete script. It works if i put only one parameter but not working with two parameters. This is not working

      <script type="text/javascript">function BindEvents() {
      $(document).ready(function () {
      $("#<%=txtID.ClientID%>")+$("#<%=txtName.ClientID%>").autocomplete('../../Common_Search/Employee.ashx');
      });
      }

      </script>

      This is working

      <script type="text/javascript">
      function BindEvents() {
      $(document).ready(function () {
      $("#<%=txtID.ClientID%>").autocomplete('../../Common_Search/Employee.ashx');
      });
      }
      </script>

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      That's not creating multiple parameters, that's appending two strings, so the ID that you would be creating would end up looking something like this - __$$txtID__$$txtName (I know, those aren't the actual characters that would be put in, but this is for demonstration) - so, the ID that the JavaScript would be looking for wouldn't exist anywhere on the page (BTW - this question has nothing to do with the .NET framework, you would have been better off posting this in the ASP.NET forum instead).

      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