Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ HTML - how to save "input" to load later on?

Posted by: OoDex Oct 2 2017, 06:10 AM

Hello all,

I have no clue of HTML, but at least so far I wrote some forms/labels,inputs and a show-button...my problem is:
I want a homepage where people write something in the input-box and I can call the value of the input-box.

Now first I wanted to keep it on the same page, I just hide all the forms and show a div. But the variables I call for don't update (or document.write(var) doesn't work in Chrome), so they just show nothing, obviously. (it works with alert(var)wink.gif

Is there any way to either update the div later on, that the variables are shown, or to somehow get where I want to be?

Posted by: Christian J Oct 2 2017, 10:54 AM

document.write only runs when the page is loaded. Also it's javascript, which means the data disappears once the user leaves the page. If you're OK with the latter you might use e.g. innerHTML instead of document.write, but if you want to store the data for the future you need a server side script like PHP.

Posted by: jokerrules Oct 4 2017, 04:31 AM

QUOTE
doesn't work in Chrome


I run into that problem quite a lot. Maybe try Firefox?

(On that note, be curious to hear which browser our resident experts here use?)

Posted by: Christian J Oct 25 2017, 04:35 AM

QUOTE(jokerrules @ Oct 4 2017, 11:31 AM) *

(On that note, be curious to hear which browser our resident experts here use?)

When making sites: all of those that are currently in use and that I have access to. When browsing the web: it varies.

"The Web Design Group was founded to promote the creation of non-browser specific, non-resolution specific, creative and informative sites that are accessible to all users worldwide." smile.gif

See also https://en.wikipedia.org/wiki/Progressive_enhancement




Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)