Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to close the autocomplete in asp.net using <DIV> tag?

code given below:

VB
Response.Write("<div onmouseover=\"this.style.cursor='pointer'; \"" +
                                      "onmouseout=\"this.style.cursor='pointer';\"" +
                                      "onclick=\"SetTextbox('" +
                                      ReturnTextbox.Trim() + "','" +
                                      mydata + "', '" +
                                      MyDiv + "');\">" +
                                      "<font size='2' face='Tahoma'><B>" + mydata + "</B></font>" +
                                      "</div>")

;
Posted
Updated 26-Oct-10 20:27pm
v2
Comments
Sandeep Mewara 27-Oct-10 2:52am    
Elaborate more on closing part.

1 solution

Hi
Just add one line in SetTextbox function you should also pass one extra parameter called this like
C#
SetTextbox(this,ReturnTextbox.Trim(),mydata,MyDiv);


C#
function SetTextbox(_this)
{
   /*your code here.. */
   _this.style.display='none';
}



Please do let me know, if you have any doubt.

Please provide "Vote" if this would be helpful, and make "Accept Answer" if this would be correct answer.:rose:

Thanks,
Imdadhusen
 
Share this answer
 
v2
Comments
Dalek Dave 27-Oct-10 3:53am    
Good 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