-
Form submit
Hi,
I have a html page which has a text box, drop down box, div tag where some contents are written, iframe and submit button.
Once after I enter values in each of the html element and press submit.
1. I want to store it locally in the system or cache.
I want to provide a link, when clicked it reads the stored information and displays the page with editable option.
Or
2. After I enter values and press submit, cache the information and display it another page when clicked on a link.
Is it possible to do?
According to the requirements, to store the information I am not using DB, i want to store it locally / caching.
Language I use: Javascript & html...
Thanks in advance,
K
-
-
HTML isn't really relevant here: it just creates the form. That's the easy surface-level part. You'll need a language capable of parsing the data to do that.
It's possible to do this in Javascript, but NOT if you submit the page: instead you will need to use a fake submit button (a regular <button>, for example) or use a real submit button with the submit action suppressed for a javascript action instead.
The common way to deal with forms (and in most cases the best) is to use PHP or another serverside language. You can store it to a text file [on the server], output it back to the user, interact with a database, send the information in an email, or do many other things.
That said, if you still want to use Javascript that's fine, but this belongs in the Javascript section because once you start processing the form, the html is all but irrelevant (except what you use for ids and values of the form fields-- just the data).
Javascript doesn't have any good "caching" mechanisms. If you do not reload the page you can 'store' it for that time (but why?), or you can try to use cookies. Cookies are fine, but if overused (too many or too much data) they may not work or may just annoy users. You'd have to add a lot of data to make them not work but a "caching system" is probably bordering on "a lot of data".
And it'll only work for users who have Javascript enabled. Server side alternatives will work for anyone. I'd suggest looking into PHP sessions-- that's how I'd approach this. But if you want to just use Javascript you can try, it's just not really designed for this.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks