How to remove html tags from Radcombobox on event of onblur

1 posts, 0 answers
  1. Manish
    Manish avatar
    66 posts
    Member since:
    Jul 2011

    Posted 14 Oct 2011 Link to this post


    I am using rad combobox and i want to do that when any <HTML> tag insert in combobox after that user go to click GO button than it should become HTML. I am able to do it on simple asp text box but not able to do it on combobox.

    Code example:

    On TextBox :
      <script type="text/javascript">
            //remove space from log text box
    function RemoveSpecialSymbols(id) {
                var objid = document.getElementById(id);
                if (objid)
                    objid.value = html2entities(objid.value);

            function html2entities(sometext) {
                var re = /[<>]/g
                //    if (sometext.length > 2500)
                //        sometext = sometext.substr(0, 2500);
                return sometext.replace(re, function (m) { return replacechar(m) })

            function replacechar(match) {
                if (match == "<")
                    return ""
                else if (match == ">")
                    return ""
    <asp:TextBox ID="txtEmail" runat="server" TabIndex="1" MaxLength="50" SkinID="RequiredTextBox" onkeydown="javascript:if (event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {RemoveSpecialSymbols(;}};" onblur="RemoveSpecialSymbols(;" ></asp:TextBox>

    Same thing i want to do it on RadCombobox....

         <telerik:RadComboBox ID="RCBSearch" runat="server" Width="250px" Height="150px" Text=""
                        ShowToggleImage="false" EmptyMessage="Search by tags, products, business name"
                        EnableLoadOnDemand="true" ShowMoreResultsBox="true" Style="float: left; margin: 0;
                        padding: 0;" EnableVirtualScrolling="true" ShowDropDownOnTextboxClick="false"
                        onkeydown="PressKeyForProfile(this, event)">
                        <WebServiceSettings Method="GetCompanyNames" Path="wsSellWithMe.asmx" />

    But it is sowing some kind of javascript error...

    "Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500"

Back to Top