By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,814 Members | 2,162 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,814 IT Pros & Developers. It's quick & easy.

a problem with a form

P: n/a
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.

Can someone please help

James
Jul 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Here is a little more information.

The form I have is a booking form for a hotel. I need to link it to a
central booking service with the following URL string

http://www.ichotelsgroup.com/redirec...otelCode=CHIWH

Using this url. But what I having trouble doing is getting the information
from my from into the string. I hope this extra info helps

James
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.

Can someone please help

James

Jul 20 '05 #2

P: n/a
Hello,

"james" <ja***@lego.co.dk> wrote in message
news:br**********@sparta.btinternet.com...
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.
After you have formed the URL into a string you can pass it to URL as:
location = myNewUrl;
Fetch more info about the 'location object' in some online reference.

Can someone please help

James

Jul 20 '05 #3

P: n/a
"james" <ja***@lego.co.dk> wrote in message
news:br**********@sparta.btinternet.com...
What I have is a series of drop down forms,
A "drop down form"? That's a new one, you may have to
elaborate/illustrate.
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.
The order of the name value pairs in a query string should not matter in
the slightest. Unless someone has done a really bad (deliberately
stupid) job of authoring the CGI script it is sent to, in which case
they should be told to fix it.

A form, provided with an ACTION attribute set the URL of the CGI script
and a METHOD attribute set to GET will, when submitted, automatically
append the query string to the URL, suitably encode the data as
required, and make a GET request to the CGI script with the resulting
URL. The exact order of the name value pairs should reflect the order of
the named form elements in the HTML, though I wouldn't rely on that,
but, as I have said, the order should not be important at all.
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.


If you want help changing code that you have written so that it does
what you want it to do you will have to allow access to the code, and
provide an HTML context in which it can be tested. (that is: post the
code or the URL of an online version so people can have a look at it).

Richard.
Jul 20 '05 #4

P: n/a
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)
Jul 20 '05 #5

P: n/a
Thanks for that, It works great, is there anyway I can get it to do
something simillar to target="_blank"?
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
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)

Jul 20 '05 #6

P: n/a
james wrote on 10 dec 2003 in comp.lang.javascript:

<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>

Thanks for that, It works great, is there anyway I can get it to do
something simillar to target="_blank"?


[Please do not bottomquote on usenet]

sure, exchange:

location.href=t

with:

window.open(t,"_blank","")

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.