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 would like to pass variables from a button to an input form on another page.
For example,
The user clicks a button with the package they want, the button loads the next page and fill out the form with the package information they have selected. What is the best way to go about this? I am designing the website using Joomla.
Thanks,
Ed
I can suggest you to use localStorage to get this done.
localStorage.setItem('testObject', value);
then get it on other page like this:
var retrievedObject = localStorage.getItem('testObject');
then set the text field with retrievedObject .
see this post to get better idea:Storing Objects in HTML5 localStorage
Related
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 9 months ago.
Improve this question
How to let user upload image in one page, and then display it in another page? User can change the image and it'll be changed also in the other page. Also, I'm talking about using php / js / jquery / mysqli anything that's most efficient. (I'm just a beginner in this field so it'll be appreciated if you use some simple language :))
Edit: Yes I said that I'm a beginner, but that doesn't mean I don't know a thing about coding. Also, I saw a few solutions from youtube & other stackoverflows questions, but all of them is about either uploading and displaying in the same page or not being able to change the image.
Format the image into Base64 string
store it in local-storage
In another page get it from local-storage and assign to the id or class.
Suggesting the link that already have answered for
How to save an image to localStorage and display it on the next page?
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have created an option that by clicking on span text shows or hides the sidebar. how to remember user selection after reloading page that the sidebar page was shown or hidden depending on the user's choice?
Once you refresh the page, everything that is not stored somewhere, for example a database, will be lost.
The easiest approach would be to save user's selection to his browser's localStorage.
So, after setting the sidebar to whatever state you want, you can save it like this:
localStorage.setItem('showSidebar', true); // or false
and then, when the page is reloaded, you can get the data like this:
var showSidebar = localStorage.getItem('showSidebar') || false;
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 6 years ago.
Improve this question
What i basically want to do is to log in a user and make a new page for every user with its own personal details.
So for example user A signs in, he would have a different view than user B.
I am using javascript ans firebase for back end.
How can i make that happen?
A rough idea would be enough.
You should use Sessions for each user and one the bases of Session value you must populate values for the user each user will have seperate details and each user will have different data page will be same but data will be different so user feels that he has a new page
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 7 years ago.
Improve this question
I am trying to make a website where the user needs to pick one image from a selection presented on the site. When the user selects a picture, i.e. clicks on it, I somehow need to retrieve the name/ID of the selected photo, and have this available on the server.
This is because I must run a bash script on my server, with the selected image ID as input.
What is the simplest way this can be achieved?
Here's how to find the id of the element you clicked ...
$(document).ready(function() {
$(".some-image").click(function(event) {
// do something with the image id below
console.log(event.target.id);
});
});
Copied almost entirely from this stack-overflow question/answer here
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 7 years ago.
Improve this question
I am working on project that require the admin to change the entire website design from a setting page. i.e logo, color theme, copyright etc. I have set the setting page and is ok..However I don't have an idea on the best way to save the data so that any time the web page loads, it
loads the data as set by the admin in the setting page. I am only looking for a rough idea..I will appreciate. thank you..
You could save the values in a database for the dynamically allocated text, or save it as a JSON. Either way should work fine.
For the database:
Create a table with 2 columns:
Key
Value
Easily select all data by the corresponding key
For example:
Key: HEADER_TEXT
Value: Hello World!
You could do the same with a JSON file with the same structure:
{
"HEADER_TEXT":"Hello World!",
"NAV_TITLE":"Navigation"
}
For the Theme, you could create a second table containing the hex/rgb colours etc. with the same structure as for your text.