Maguire
06-28-2012, 03:05 AM
Hi,
I've almost got a table swap out feature on my page working (thanks to Old Pedant) but there is one thing that is eluding me. (Page is at http://www.the-house-plans-guide.com/joist-span-tables-with-script.html#joistspancalculator)
If you refresh (reload) the page, the previously stored value of the drop down list is still shown but the default table (which is set to be visible) is displayed. This could result in the wrong table being shown for what is displayed in the drop down.
Could I add an addEventListener("load"...) to somehow reset the dropdown value anytime the page is reloaded? How would I implement this?
I would also need to reset the dropdown value if the user used their browser back (or forward) arrow and then returned to the page as the table is reset in this instance too.
Sorry I know this is probably very basic but I'm just figuring out Javascript after not doing any programming since the days of Pascal (the language not the person!).
Thanks.
Susan
I've almost got a table swap out feature on my page working (thanks to Old Pedant) but there is one thing that is eluding me. (Page is at http://www.the-house-plans-guide.com/joist-span-tables-with-script.html#joistspancalculator)
If you refresh (reload) the page, the previously stored value of the drop down list is still shown but the default table (which is set to be visible) is displayed. This could result in the wrong table being shown for what is displayed in the drop down.
Could I add an addEventListener("load"...) to somehow reset the dropdown value anytime the page is reloaded? How would I implement this?
I would also need to reset the dropdown value if the user used their browser back (or forward) arrow and then returned to the page as the table is reset in this instance too.
Sorry I know this is probably very basic but I'm just figuring out Javascript after not doing any programming since the days of Pascal (the language not the person!).
Thanks.
Susan