A little text manipulation (ASCII values)
Posted on 2003-03-25
Hope the title is not misleading -
I have a drop-down box that I use to select a year.
I would like to have other buttons or icons on the page that call up different pages based on the year selected.
In other words, say there are buttons called "NEWS", "PHOTOGRAPH", and "INFO" next to the drop-down box for the year.
The user first selects a year (which I already have calling up another page when SUBMIT is pressed).
Then if the user wants to see news on that year, he/she clicks the NEWS button. Or the PHOTOGRAPH button or INFO.
So behind the scenes, the drop-down form has a variable named 'Year'.
How can I take the value of 'Year' and combine it with other text in the other buttons?
For example: Pressing NEWS would take the value of 'Year' + a filename literal entered in the button form such that pressing it would call up a page using the combined text.
So I am basically building a new text string from different points.
In a formula (from other languages) it might look like this:
Webpage = "news-" + Year + ".htm"
So if the year selected is 2003, the result of Webpage = "news-2003.htm"
I could then retrieve that particular page.
It is probably simple HTML code so excuse the ignorance - thanks in advance!