how to store new elements added in webpage by user? [closed] - javascript

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I want to store user changes in my webpage so that user can go to next page then come back on that page so that elements which he added should be there when he comes back for editing the webpage. I do not want to store data to the database until he submits the form.
let me explain with the example
in this image user add a new item to list by entering the name in input field I want to store these new items so that user can go to next and can come back with the list item present

You can use JavaScript to set a cookie with all the changes you want to keep. If the user returns to the page later, restore the changes from the cookie.

Related

Calculadora - Show resultado Javascript [closed]

Closed. This question is not written in English. It is not currently accepting answers.
Stack Overflow is an English-only site. The author must be able to communicate in English to understand and engage with any comments and/or answers their question receives. Don't translate this post for the author; machine translations can be inaccurate, and even human translations can alter the intended meaning of the post.
Closed 5 days ago.
Improve this question
The calculator is ready. But, I can't find a way to make the result appear only when the user clicks the "save" button. So far, in codepen, it works (with the exception of making the result appear).
Another problem arises when all the code is posted on my site. When clicking on the "save" button, it does not display the result and the page loads.
HTML, CSS and Javascript codes are in the codepen: <https://codepen.io/kleyton/pen/QWVLemd>
The myDIV div must remain hidden until the user clicks on the button and it displays the results. That's the goal at the moment.
Thank you in advance for any help!

how do i send data to the clicked link in html/java/css [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
what i need is a system that will let me send some data when a user clicks a link.
for example, if i had an html or javascript file that would display a color depending on data it gets, and the link you click to get there sends the data to that site that determines the color (sets a variable in javascript, or something like that).
i havent tried anything yet since i am new to html and have no idea how to do things that involve interacting scripts. i have looked at github projects with the results i want that use a '#' in the url
You can send the color you want the other site to show in a GET parameter.
E.g, your anchor could look something like this:
Red
Then, on site.com/page, you can use JavaScript to get the color parameter value:
const color = new URLSearchParams(window.location.search).get('color')

HTML5 reset button: change initial values after a save/submit [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
Using HTML5's reset button I can easily reset the form to it's "initial values" (the ones when the form was created/loaded).
What happens is, I submit the form using ajax, that means the entity/data is now updated. So, is there a way to tell the browser that those submited values are now the "initial values", so if the user hits the reset button it does not reset to the old values?
Thanks!
[edited]
We have standard forms for our applications, with a Save/Cancel button on them. If you save the entity, we remain in the form. We're using Aurelia Framework with Syncfusion for our UI.
I don't know much about Aurelia or Syncfusion, but an HTML reset input will reset every input element in the form to its value attribute. So if you use setAttribute to replace the element's value attribute with the new value, the reset button will use that one as the "initial" value from then on.

Autofilling a different webpage with user input [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am trying to find out how I can make a program in JavaScript/HTML that takes a user's input and automatically enters this information onto a different web page. I am new to JavaScript/HTML so any help would be appreciated!
You specified the website as:
Supreme
Now, when you go to checkout, right click and click Inspect Elements. Then find all of the input fields on the website. For example, I found the Full Name input field. The field has a name: order[billing_name]
What you want to do next is in your URL do something like this:
https://www.supremenewyork.com/checkout?order[billing_name]=yourname
Now if you want multiple values (most likely) you need to find the names of the other fields and add the values to the URL, as so:
https://www.supremenewyork.com/checkout?order[billing_name]=yourname&order[email]=youremail
This way you can pass the values from your application and fill in the form on that website.
Hope this helps.
Use localstorage. see working demo in the link below;
Note: localStorage won't work in snippet; hence I made a fiddle.

How to save user input data in the form? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a two page form, when a user fills out the first page he/she can either click Save For Later, or click Next and proceed to the next page and continue filling out the form. It is done through jquery. What I cannot figure out how to do is, how can I save the user input in the form, so if the browser crashes, internet goes out, or user simply wants to save form and come back to it later, the filled out information sits in the input fields. What is a method to accomplish that?
This is more or less general solution to your problem: use localStorage to store the user input:
<body onload="if(localStorage.userEdits){document.getElementById('name').value=localStorage.userEdits}" id="myForm">
<form>
<input id="name" type="text" onkeyup="localStorage.userEdits=this.value"/>
</form>
</body>
It will store the value of your input every time you press a button on your keyboard to type something, and retrieve this info on load.
There are various ways you can easily achieve this behavior.
One of them, is to provide draft feature. This feature will allow user to save the form data when...
a) They click next
b) they leave and session is timed out
c) Complete the form and don't want to submit it
This way is more secure and reliable.
It think that you can realise it with storing the login credintials with PHP in a session or something like this. If the user visits the website again your PHP-script sees that there is a session with credentials and you can show them to the user.
An other method would be to save this data in a localStorage on the device of the visitor but I wouldn't use this method because not all browser are accepting localStorages.

Categories

Resources