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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:10:58+00:00 2026-06-11T23:10:58+00:00

Okay, I’m pretty sure I’m missing something very obvious here, but I just couldn’t

  • 0

Okay, I’m pretty sure I’m missing something very obvious here, but I just couldn’t find a proper solution so far. What I’m trying to do is simple: Have a user write something into a form, have him submit the form, and write that input into a textarea on the same page.

This is my code:

<html><head></head>
<body>
<form name='registration'>
<label for="input">Input:</label>
<input type="text" id="input"/>
<input type="submit" id="submit" value="Submit" onclick="execute()"/>
</form>

<div id="results">
<span>Result</span>
<span><textarea cols="30" rows="5" id="resulttext" readonly="readonly"></textarea> </span>
</div>

<script>
function execute()
{
    var result = document.getElementById("input").value

    document.getElementById("resulttext").value=result;
}
</script>

</body>
</html>

Now what happens if I enter something into the form is that the textarea briefly shows my input before reverting back to showing nothing. My guess is that the textarea field is only changed for the duration of the execute() function.

When I change input type="submit" to a <button> everything works as intended, but I’m pretty sure I’m not supposed to do that.

  • 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-11T23:10:59+00:00Added an answer on June 11, 2026 at 11:10 pm

    You need to cancel the default event for the submit button, otherwise it just submits the form (which in this case essentially reloads the page since there are no form elements with names). Add return false;after execute() (put a ; in between the two pieces)

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

Sidebar

Related Questions

OKay, this is probably pretty noob, but I couldn't find how to solve it.
Okay, this is probably a very basic question; but, I'm just getting back in
Okay, I have GOT to be missing something totally rudimentary here. I have an
Okay I've spent the last hour trying to find a solution to this but
Okay, so this is a long long shot but here it goes... When IE
Okay, this one is pretty obvious to everyone who use Django and frequently asked
Okay, so the answer to my question might not be the problem but here's
Okay i know i have to use the JDBC etc, but im not sure
Okay, I know I have to be doing something wrong here because the performance
Okay this question is very simple: I have a facebook page, and a website.

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.