james wrote on 10 dec 2003 in comp.lang.javascript
:
I hoping someone can help me.
What I have is a series of drop down forms, they are dates and other
things. What I need to do is get these values and input them into a
URL string in a certain order.
I have been trying to get this to work for ages. I think I have the
function done correctly for the for I just can not get it into the url
string.
Others will tell you why it is not very necessary,
I will show you it van be done,
forgetting even to use the <form> element:
<SELECT id="first">
<OPTION value="1">one
<OPTION value="2">two
</SELECT>
<SELECT id="second">
<OPTION value="3">three
<OPTION value="4">four
</SELECT>
<button onclick="doURL()">
do it
</button>
<script>
function doURL() {
nfirst=document.getElementById("first").value
nsecond=document.getElementById("second").value
t="http://thisismysite.com/second="+nsecond+"&first="+nfirst
alert(t)
location.href=t
}
</script>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)