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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:24:29+00:00 2026-06-03T01:24:29+00:00

Is it possible to save data from form to localStorage AND submit the form?

  • 0

Is it possible to save data from form to localStorage AND submit the form? I need to submit the form but it would be important to save the values to localStorage also. How can I do this?

Here is the code I have for the form and localStorage, but this doesn’t submit the form. It just saves the values.

<label for="server"> Server: </label> 
<input type='text' name="server" id="saveServer"/> 
<button onclick="save_data()" type="button" value="Save" id="Save" data-theme="a">Save</button> 
<script> function save_data()
{ var input = document.getElementById("saveServer");
localStorage.setItem("server", input.value); 
var storedValue = localStorage.getItem("server"); } 
  • 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-03T01:24:31+00:00Added an answer on June 3, 2026 at 1:24 am

    Sure, but you’ll probably want to shake up your approach a bit to call save_data as the form is being submitted:

    <form onsubmit="save_data()">
      <!-- The rest of your form goes here -->
      <button type="button" value="Save" id="Save" data-theme="a">Save</button> 
    </form>
    
    <script> 
    function save_data() {
      var input = document.getElementById("saveServer");
      localStorage.setItem("server", input.value); 
      var storedValue = localStorage.getItem("server"); 
      // etc..
    }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible to read mongodb data with hadoop connector but save output as
I have some data recieved from a simple HTML form like this: $newdata =
I read this is possible to do in ASP, but I need to know
With AIR 2 allowing access to mic data, it's possible to save/process audio locally.
How is it possible to save text from a text field when the user
is it possible to save the .xml file from the screen to main.xml? my
Does anybody know if its possible to save the windows event logs from a
I need to be able to send an image and some form fields from
tl;dr: Is it possible to intercept posted values from a nested model for further
I'm trying to export data from a web app into excel, but there is

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.