In the following code (the syntax of which I obtained from an on-line tutorial):
<input type=”button” name=”map” value=”Click” onClick=”Javascript:self.location=’../maps2/surface/slideshows/200501/images/2005010100.gif'”>
I want to go to the URL that comes after the ‘location’ statement (the above are sub-directories, as is probably obvious). The numbers are derived from dropdown boxes like this:
<select name=”mapyear”>
<option value=”2005″>2005</option>
Similar options are used to get month, day and hour, which in the above example are represented by the ‘010100’.
I used the above example to see if I had other syntax right, and the .gif file loaded. But I need to choose the year (2005), month (01), day (01) and hour (00) after the ‘location’ statement. By that I don’t mean those numbers (I just give those as examples), but any year, month, day and hour.
It seems I have to concatenate the 4 numbers, but when following online advice to use a plus sign, it didn’t work.I also tried defining variables and that made no difference either. I tried substituting ‘mapyear’ (the name of the ‘year’ dropdown option, shown in the above code) for 2005 but that failed. The main issues are that I don’t know what to put in between the items called by the <option value> tags (eg ‘ or & or “” or +), nor how to declare these as variables correctly if necessary (having tried that and not succeeded).
So, how do I relate what follows the ‘location’ statement to what’s been chosen in each of the <option value> tags, so that if, for example, I choose the above parameters in the dropdown boxes, that file will load?
Thanks