Guest User

Untitled

a guest
Aug 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. How to append (;) to a string in a autocomplete text box
  2. string[] result = txt_to.Text.Split(';');
  3.  
  4. <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txt_to"
  5. MinimumPrefixLength="2" CompletionInterval="10" CompletionSetCount="3" EnableCaching="true"
  6. FirstRowSelected="true" UseContextKey="True" ServiceMethod="GetCompletionList"
  7. DelimiterCharacters=";" ShowOnlyCurrentWordInCompletionListItem="true" />
  8.  
  9. function GetKeyPress(){
  10. if (window.event.keyCode == 13){
  11. document.getElementById ('txt_to').value +=";";
  12. }
  13. }
  14.  
  15.  
  16. function addSemiColumn(){
  17. document.getElementById ('txt_to').value +=";";
  18. }
  19.  
  20. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  21. If IsPostBack Then
  22. txt_to.Focus()
  23. End If
  24. txt_to.Attributes.Add("OnKeyPress", "GetKeyPress()")
  25. End Sub
Add Comment
Please, Sign In to add comment