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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:07:37+00:00 2026-05-18T21:07:37+00:00

[EDIT] After a lot of digging around, I found out that the problem was

  • 0

[EDIT] After a lot of digging around, I found out that the problem was in how I integrated the CKEditor into my page. The simple and obvious way does work in this case, as laid out in the accepted answer.

Hi,

I need to change the values of a form, after the submit button has been pressed, but before the actual submission has taken place.

I’ve tried hooking into the “submit” event of the form, and changing the text field values there manually, but it looks like that doesn’t actually change the values submitted.

Any ideas?

  • 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-18T21:07:37+00:00Added an answer on May 18, 2026 at 9:07 pm

    I’m curious about your statement that the submit handler didn’t work for you. It does for me. I’ve used it for years to fill in hidden fields before sending forms in; should work for other form fields as well.

    Example (live copy):

    HTML:

    <form id='theForm'
        action='http://www.google.com/search'
        method='GET' target='_new'>
          <label>Search for:
            <input type='text' name='q' id='txtSearch'></label>
          <input type='submit' id='btnSearch' value='Search'>
    

    JavaScript:

    window.onload = function() {
    
      document.getElementById('theForm').onsubmit = function() {
        var txt = document.getElementById('txtSearch');
        txt.value = "updated " + txt.value;
      };
    };​
    

    Tested and working on IE6 and IE7 on Windows, and Chrome, Firefox, and Opera on Linux.


    Update: Based on your comment below, you’re using jQuery. Works fine using jQuery for everything as well:

    $('#theForm').submit(function() {
      var txt = $('#txtSearch');
      txt.val("updated " + txt.val());
    });
    

    Live example Tested and working on the same set of browsers. This version uses a more open search rather than an id, and also still works.

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

Sidebar

Related Questions

FINAL EDIT: After following the answer from Darin Dimitrov, I have found that the
EDIT: My mistake was that I had a go after the first select statement
[EDIT] I am changing this to more concisely explain what my problem was, after
After a lot of googling I'm unable to find a solution to this problem.
This seems like an elementary question, but after a lot of searching around I
After a lot of effort, I've managed to piece together a function that deletes
Edit note: After a seemingly enourmous amount of bad feedback MS got from their
I'm trying to immediately set a row to Edit mode after it is created.
Possible Duplicate: Saving changes after table edit in SQL Server Management Studio I need
oo design basics here... Edit: To clarify after first answer - I'm not asking

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.