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 8925779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:47:31+00:00 2026-06-15T07:47:31+00:00

I have a very simple form with three fields that I need to submit

  • 0

I have a very simple form with three fields that I need to submit to an mvc action. The form must be application/x-www-form-urlencoded. however, one of the fields is populated by users copying and pasting an already urlencoded value. I would like to decode that value prior to submitting the form. this seems really simple but I keep running into proplems with my javascript.

Here is the code:

   <html>
    <head>
<script>
function decodeURI()
{
decodeURIComponent(document.createprofile.URI.value);
}
</script>
    <title>Test Create</title>
    </head>
    <body>
    <center>
    <h1> Spoof Profile Calls </h1>
    <hr>
    <div style="border: 1px solid black; width: 300px;">
    <b>Create</b>
    <form method="post" action="https://test.test-lab.com/Profile/Create/" name="createprofile">
    <input type="hidden" name="ReturnURL" value="self.close()">
    UserName: <input type="text" name="UserName"><br />
    Client: <input type="text" name="Client"><br />
    URI: <input type="text" name="URI" onblur="decodeURI();"><br />
    <input type="submit" formenctype="application/x-www-form-urlencoded" value="Go To - Create"><br />
    </form>
    </div>
    </body>
    </html>

The URI field is the one that needs url decoded prior to submission because it gets reencoded and thus corrupted. I could ask the users to un-encode these values themselves but they are not terribly sophisticated users and it will likely not happen.

Thank you in advance!

UPDATED WITH FAILING CODE

  • 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-15T07:47:32+00:00Added an answer on June 15, 2026 at 7:47 am

    Replace the line

    URI: <input type="text" name="URI" onblur="decodeURI();"><br />
    

    by

    URI: <input type="text" name="URI" onchange="decodeURI(this);"><br />
    

    And do something like

    function decodeURI(elm) {
        elm.value = 'foo ' + elm.value + ' bar';
        return false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP form that needs some very simple validation on submit. I'd
I have a very simple entry form. After a button is pressed, I need
I have a very simple XAML form, that has one namespace definition. For some
So I have 4 pages. They are very simple. index.php (WORKS) <html> <form action=upload.php
I have a very simple script that creates a user: <?php include 'mysqlserver.php'; session_start();
I have a very simple model that includes the auto-filled field much like 'created'.
I have a simple form that is used to update an entity in my
I have an array of stdClass objects that are very simple, every object looks
I'm looking at creating a very simple HTML page that contains an HTML form
I m building a very simple form validation which validates only required fields. This

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.