Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1114797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:03:41+00:00 2026-05-17T03:03:41+00:00

I have a search form in my web application that throws an Apache 400

  • 0

I have a search form in my web application that throws an Apache 400 Bad Request error when you search using an apostrophe (smart quote, i.e. ’ not '). This happens when someone copy and pastes from Microsoft Word (which automatically converts tick marks to smart quotes).

search box

The form causes a GET request which puts the search string in the URL. Even when I encode the string, it causes this error. What should I do to get this to work?

<script type="text/javascript">

function zend_submit_main() {

    var query = $('#search_field').val();

    if(query != '') {
        var search_field = '/query/' + escape(query);
        var url = '/search/results' + search_field + '/active-tab/contacts';
        window.location = url;
    }

    return false;
}

</script>

<form id="search_form" method="GET" onsubmit="zend_submit_main(); return false;">
    <input type="text" value="search by contact name" onFocus="if (this.value=='search by contact name') { this.value=''; }" onBlur="if (this.value=='') { this.value='search by contact name'; }" name="search_field" id="search_field" style="width:160px;" />
    <input type="submit" value="Go" />
</form>     
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T03:03:42+00:00Added an answer on May 17, 2026 at 3:03 am

    Use encodeURIComponent instead of escape:

    var search_field = '/query/' + encodeURIComponent(query);
    

    escape is not a standard function and does not encode the value according to the Percent-encoding as specified by RFC 3986. ’ for example is encoded as "%u2019.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've written a web application using Catalyst that has a lot of forms and
I have a web form, that needs to save the data that the user
I have a decent working web application (Java/Servlet/Jsp) that I would like to improve
I have a search form with a query builder. The builder is activated by
I have a search form in an app I'm currently developing, and I would
I have a search form on each of my pages. If I use form
I have a search form and result list. The form allows the user to
I have a really simple search form with the following Label (Search) Textbox (fixed
I have a search box that doesn't have a submit button, I need to
I have a search program that will be looking at a database from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.