473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

a problem with a form

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
6 1283
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
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
"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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mark | last post by:
Hi, Im trying to validate a form, all the validating works apart from one field. This particular field must consist of the first 2 characters as letters, & the following 5 as numbers. And if it...
4
by: Targa | last post by:
Trying to total some price fields in a form but doesnt work when all the referenced form fields dont exisit. This is for an invoice - pulled prom a database and the form doesnt always contain the...
0
by: Tim Haughton | last post by:
I've just released an article on using Test Driven Development with C# and Windows Forms. GUI's are often difficult to test, so I thought it might be of interest. The article along with the...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
10
by: sara | last post by:
Hi - I have been struggling with solution ideas for this now for almost 2 weeks, and have not been able to figure this out. I have a user who creates a Purchase Order (tblPOData). In some...
5
by: Neil | last post by:
"lyle" <lyle.fairfield@gmail.comwrote in message news:48c3dde7-07bd-48b8-91c3-e157b703f92b@f3g2000hsg.googlegroups.com... Question for you. I'm doing something similar, only, instead of opening...
5
by: simononestop | last post by:
Hi im totally new to perl this is my first go at using it (I normally use asp). I have set up a form with a cgi script from demon hosting. I have edited the script and the form works it sends me an...
1
by: somnamblst | last post by:
I have a Flash form that uses ASP to write to Access db. I have an HTML form that uses ASP to upload files and email those files and sends copies to recipients based on the form fields. I would like...
1
by: swathichavalla | last post by:
Problem description: Clients working with an apple computer with the safari browser are experiencing problems with brokerage orders. When the client wants to enter a stock order, the order entry...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.