Link to home
Create AccountLog in
Avatar of dana Rooki2020
dana Rooki2020

asked on

.Net error with Searching if special sign ‘ is used in search

Like to make it possible that you can search O´Neill on our homepage and MS-SQL error the search/page.
What do we need to add to our Searchfield to allow this ? Here our search page today:

  <%
            if request("ArticleNo")<>"" then
                ArticleNo = request("ArticleNo")
            else
                ArticleNo = "Artikel Nr."
            end if
            if request("search")<>"" then
                search = request("search")
                if IsNumeric(search) then
                    ArticleNo = search
                    search = "Freitextsuche"
                end if


  <script language="javascript" type="text/javascript">
                $(function () {
                    function initPage() {
                        $('#search').attr('value', '<% = search %>');
                        doSearch();
</script>

<td>
                                <input id="search" name="search" type="text" size="20" class="search2 rounded" onBlur="if(this.value=='')this.value='Freitextsuche';" onFocus="this.value='';" value="" />
                            </td>
ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account