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

  • SEARCH
  • Home
  • 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 7948507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:44:27+00:00 2026-06-04T01:44:27+00:00

Say I have a simple form like this: <html> <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8

  • 0

Say I have a simple form like this:

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  </head>
  <body>
    <div id="search">
      <form method="GET" action="/super-action">
        <input type="text" name="q" />
      </form>
    </div>
  </body>
</html>

with an input like: @tags "Cinéma Whatever"

a form GET request results in a url that looks like: /super-action?q=%40tags+"Cinéma+Whatever"

Now I want to reproduce that with javascript in location.hash, with a pound sign instead of a slash, like: /super-action#q=%40tags+"Cinéma+Whatever"

But with the available functions, I get there results:

  • escape(input): @tags%20%22Cin%E9ma%20Whatever%22
  • encodeURI(input): @tags%20%22Cin%C3%A9ma%20Whatever%22
  • encodeURIComponent(input): %40tags%20%22Cin%C3%A9ma%20Whatever%22
  • $(form).serialize(), without q=: %40tags+%22Cin%C3%A9ma+Whatever%22

The question: How can I make an input value, like @tags "Cinéma Whatever", look like what a form GET request would do: %40tags+"Cinéma+Whatever" using javascript?

  • 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-06-04T01:44:28+00:00Added an answer on June 4, 2026 at 1:44 am

    According to RFC 1738, /super-action?q=%40tags+"Cinéma+Whatever" is not valid inside an URL:

    Thus, only alphanumerics, the special characters “$-_.+!*'(),”, and
    reserved characters used for their reserved purposes may be used
    unencoded within a URL.

    That means that you can’t produce a valid URL with that substring in it. You must encode the special characters " and é, otherwise the resulting string is not a URL.

    The reason why you think this is valid might be that your browser plays tricks on you: It could be displaying the URL in partially encoded form to make it easier to read in the address bar. Try using a protocol analyzer like Wireshark to inspect the actual URL path sent across the network.

    UPDATE: I quickly confirmed this, the HTTP header sent in reaction to a form submit is the following:

    GET /?q=%40tags+%22Cin%C3%A9ma+Whatever%22 HTTP/1.1
    

    So it is first UTF-8 encoded and then URL encoded.

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

Sidebar

Related Questions

I have very simple form, with input like this: <input id=my_id multiple=true type=file name=image_name[]
I have a very simple form in HTML and I'd like to submit this
I have have a simple HTML form with say four input widgets (see below)...two
I've got this HTML form where I have multiple input elements: text, radio, and
Say I have this simple form: class ContactForm(forms.Form): first_name = forms.CharField(required=True) last_name = forms.CharField(required=True)
Say I have this simple method: public IEnumerable<uint> GetNumbers() { uint n = 0;
Seems like a simple problem, I have a form and when someone needs to
I have very simple contact form and I would like to hide the label
Lets say I have a working form that looks like the following =form_for @survey
Say I have simple program that emulates a board game with a number of

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.