Click here to Skip to main content
15,906,463 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello
I have this javascript code with inputs (project,project-id)

JavaScript
<script>
  $(function() {
    var projects = [
      {
        value: "jquery",
        label: "jQuery",       
      },
      {
        value: "jquery-ui",
        label: "jQuery UI",
      }
    ];
 
    $( "#project" ).autocomplete({
      minLength: 0,
      source: projects,
      focus: function( event, ui ) {
        $( "#project" ).val( ui.item.label );
        return false;
      },
      select: function( event, ui ) {
        $( "#project" ).val( ui.item.label );
        $( "#project-id" ).val( ui.item.value );
        return false;
      }
    })
    .autocomplete( "instance" )._renderItem = function( ul, item ) {
      return $( "<li>" )
        .append( "<a>" + item.label + "<br>" + item.desc + "</a>" )
        .appendTo( ul );
    };
  });
  </script>


its worked but i want to change the type of "project-id" to asp textbox
how do i change this
JavaScript
$( "#project-id" ).val( ui.item.value );
Posted

1 solution

What are you talking about? There is no such thing as an "asp textbox". Those ASP tags in the source aspx page get rendered as normal HTML textbox controls. The javascript code can't tell the difference between a textbox specified by normal HTML and one specified by an ASP tag because they are exactly the same.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900