Wednesday, 7 October 2020

Basic LocalStorage

 Without reading your code but just your scenario, I would solve by using localStorage. Here's an example, I'll use prompt() for short.

On page1:

window.onload = function() {
   var getInput = prompt("Hey type something here: ");
   localStorage.setItem("storageName",getInput);
}

On page2:

window.onload = alert(localStorage.getItem("storageName"));

You can also use cookies but localStorage allows much more spaces, and they aren't sent back to servers when you request pages.

Auto select after redirect to the contact page SELECT JAVASCRIPT

 https://domain.my/contact/?startup_package=UltimateImpact         <select name="startup_package" class="form-select"...