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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:55:56+00:00 2026-06-05T17:55:56+00:00

Here’s a brief rundown of my issue: I have a JavaScript function that gets

  • 0

Here’s a brief rundown of my issue:

I have a JavaScript function that gets the value of a bunch of form fields, then combines them into another variable called outputArea, and then I use the same function to change the value of a textarea called “outputArea” to the value I created for outputArea in the JScript (document.thisForm.outputArea.value = outputArea).

but when I press the “Make My Notes” button that calls the function, it grabs the variables, hits my alert to dump the variables to make sure its working, then outputs to the form field I want it to… however, IMMEDIATELY after the function completes, it clears itself. By itself, I mean the whole form clears, including the outputArea.

I’ve checked my source numerous times and there are 0 references to a reset button or anything that should be clearing these values after the function is called, so I’m at a loss.

Below is my function:

<script type="text/javascript">
    function getNotes() {
        var spokeTo = document.thisForm.spokeWith.value;
        var problemWith = document.thisForm.problemWith.value;
        var resolvedBy = document.thisForm.resolvedWith.value;
        var thisTech = document.thisForm.techName.value;
        var liveChat = document.thisForm.onLiveChat.value;
        var passTo = document.thisForm.passTo.value;
        var fSpace = ".  ";
        var fSign = "  - ";

        alert(spokeTo + problemWith + resolvedBy + thisTech);

        outputValue = 'Spoke with: ' +spokeTo + fSpace + problemWith + resolvedBy + passTo + fSign + thisTech;
        document.thisForm.outputArea.value = outputValue;
        alert('DISMISS');
    }

the button that calls the function is simply:

<input type="submit" class="button" value="Make My Notes!" onClick="javascript:getNotes();" tabindex="4" style="margin-right:1em;" />

and the output field:

<textarea name="outputArea" id="outputArea" onClick="this.select();" readonly="yes"></textarea>

I added the alert(‘DISMISS’); in an attempt to see if I could (temporarily) stop the form from clearing itself by forcing the user to press OK to the alert, but strangely enough, it calls that Alert BEFORE it calls the document.thisForm.outputArea.value = outputValue, which I don’t understand. After it calls it and outputs, it immediately clears EVERY form field. This is currently the only javascript function on the whole page, and there are no reset buttons anywhere in sight.

I’ve done this tons before and actually have an application with a similar method running and working fine right now, so I’m completely baffled. What in the heck am I doing wrong here?

I greatly appreciate anyone taking time looking into this for me. Cheers!

  • 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-05T17:55:58+00:00Added an answer on June 5, 2026 at 5:55 pm

    This actually looks to me like your page is refreshing itself because the button is performing a submit action. Change your onClick event to this:

    onClick="getNotes(); return false;"
    

    Because this is generating a POST request (probably to itself), the page is loading as if for the first time.

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

Sidebar

Related Questions

Here is the issue I am having: I have a large query that needs
Here is the problem that I am trying to solve. I have two folders
Here's the setup - I have a view that lists products. On that same
Here is a scenario: User installs .NET application that you have made. After some
Here is my code (Say we have a single button on the page that
Here's a problem I ran into recently. I have attributes strings of the form
Here's my scenario - I have an SSIS job that depends on another prior
here is code: <script type=text/javascript> function doit(){ $('table td').each(function () { if ($(this).text().trim() !=
Here's a piece of code I copied from http://www.schillmania.com/content/projects/javascript-animation-1/demo/ Very simple JS animation: function
Here's the basic setup: I have a thin bar at the top of 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.