简体   繁体   中英

Display text input from form on another file

what i am trying to do is to have one file with forms that can be filled out, some sort of setting page. When the form is filled out id like to display the input in another file. So one page to put the input and another one to display it.

I already tried to do it with.getElementById, it worked in the sense that i could display the input but only on the same page.

Thank you for your help

From what you have mentioned, you can useWebSockets . You cannot use selectors that are in a different page.

When you fill the form, send a message to server and then the server can emit the message. Just like a chat room.

You can use session variables to do that.

For example Once the form is filled user clicks on the submit button, that will sent the form elements (egname,number,text,etc.) to the session variables using POST method.

And the session variables are accessed,modified throughout the session.

You can store form info into the browser local storage

  • localStorage.setItem('key', 'value') to create or modify data
  • localStorage.getItem('key', 'value') to access data
  • localStorage.removeItem('key') to delete data
  • localStorage.clear() to delete all data

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM