473,395 Members | 1,488 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,395 software developers and data experts.

Creating a form that reads the parameters from the URL and can by used by IE7

Hi,

IE7 has a search bar from which you can search on the internet. It is
also possible to add a site to the list of sources for this bar. The
only disadvantage of this is that it pass the full text entered in the
search bar as one search term to the destination site. This is no
problem for Google but it is for sites like the Dutch phonebook
(http://www.detelefoongids.nl). These kind of sites are using more
than one search term, each separated. E.g. Name and City.

So what I am planning to do is to create my own search page and split
the arguments in the URL and use them to redirect to the phonebook
site.

The exact URL used by the phone book is
http://dtgi.detelefoongids.nl/dtgi/Z...waar=amsterdam
where "jansen" is the name of the person and "amsterdam" the city.
"Wie" is the dutch translation of who and "waar" stands for
"location".

Basically this is what I have planned:
1) Create a form with two fields, name and city;
2) When clicking on submit it will forward the visitor to the URL
mentioned above by passing the values of the form fields to this URL;
3) The form must also be able to read the values from the URL passed
from the IE7 search bar (see below for more information);
4) When the IE7 search bar is used the form must submit automatically.

Note for the 3th point above:
Because IE7 will pass all text as one term to the destination site the
URL of my page, opened from the search bar, will be something like
"http://domain.com/phonebook.html?terms=<name<city>". As you can see
the name and city are not separated. These are in this format
undetectable by any script in the form. The only way to separate them
is to let the user add a character manually when entering the text in
the search bar. For example: name+city. In this case the URL for my
page, opened from the search bar, will be "http://domain.com/
phonebook.html?terms=<name>+<city>".
As you see the form must be able to separate the name and the city by
using a + sign as the separator.

I am only partially able to create a page with this form. Is somebody
out there who is able to set this thing up?

Regards,

Jasper

Mar 5 '07 #1
3 1394
On 5 Mar, 12:26, where...@hotmail.com wrote:
Hi,

IE7 has a search bar from which you can search on the internet. It is
also possible to add a site to the list of sources for this bar. The
only disadvantage of this is that it pass the full text entered in the
search bar as one search term to the destination site. This is no
problem for Google but it is for sites like the Dutch phonebook
(http://www.detelefoongids.nl). These kind of sites are using more
than one search term, each separated. E.g. Name and City.

So what I am planning to do is to create my own search page and split
the arguments in the URL and use them to redirect to the phonebook
site.

The exact URL used by the phone book ishttp://dtgi.detelefoongids.nl/dtgi/ZoekInDeTelefoongids.do?locationTy...
where "jansen" is the name of the person and "amsterdam" the city.
"Wie" is the dutch translation of who and "waar" stands for
"location".

Basically this is what I have planned:
1) Create a form with two fields, name and city;
2) When clicking on submit it will forward the visitor to the URL
mentioned above by passing the values of the form fields to this URL;
3) The form must also be able to read the values from the URL passed
from the IE7 search bar (see below for more information);
4) When the IE7 search bar is used the form must submit automatically.

Note for the 3th point above:
Because IE7 will pass all text as one term to the destination site the
URL of my page, opened from the search bar, will be something like
"http://domain.com/phonebook.html?terms=<name<city>". As you can see
the name and city are not separated. These are in this format
undetectable by any script in the form. The only way to separate them
is to let the user add a character manually when entering the text in
the search bar. For example: name+city. In this case the URL for my
page, opened from the search bar, will be "http://domain.com/
phonebook.html?terms=<name>+<city>".
As you see the form must be able to separate the name and the city by
using a + sign as the separator.

I am only partially able to create a page with this form. Is somebody
out there who is able to set this thing up?

Regards,

Jasper
this is really about /server/ side logic
you have two types of data neither of which have a specific format.
so just assume the user enters
name, location
or
name location
then use server side logic to split the words up,

there are only a few reasonable variants which will cover 99% of all
cases.

Try to match the location from the list in your database, I assume you
have all the locations in question in a database. (for instance here
in England having only 45000 location names will get almost everwhere
from the tiny hamlet to the largest city and its regions)
There's no point returning anything unless they have entered the
location correctly anyway. (unless you use SOUNDEX to return likely
mistakes)
If you cant find a match for the lcoation widen the match to include
the last two words and try that, then return a soundex match, and a
hint "lastname, location"

It will work fine, with just 20ms more database time than before.
If you want to have a list of names in there as well, and use reg exp
or other matching, that will work too. Lists are available on the net.

Mar 5 '07 #2

wh******@hotmail.com wrote:
Basically this is what I have planned:
1) Create a form with two fields, name and city;
2) When clicking on submit it will forward the visitor to the URL
mentioned above by passing the values of the form fields to this URL;
3) The form must also be able to read the values from the URL passed
from the IE7 search bar (see below for more information);
4) When the IE7 search bar is used the form must submit automatically.
------
window.location.href.match(/.*\?.*?terms=(.*?),(.*)/i)
name=RegExp.$1;city=RegExp.$2
if(RegExp.$1 && RegExp.$2)
window.location.replace("http://dtgi.detelefoongids.nl/dtgi/
ZoekInDeTelefoongids.do?
locationType=LOCALITY&req_source=homepage&type=bas ic&wie="+name
+"&waar="+city)
------

Mar 5 '07 #3
On Mar 5, 8:02 am, scripts.cont...@gmail.com wrote:
where...@hotmail.com wrote:
Basically this is what I have planned:
1) Create a form with two fields, name and city;
2) When clicking on submit it will forward the visitor to the URL
<html>
<head><titleTitle </title>
<script type="text/javascript">
window.location.href.match(/.*\?.*?terms=(.*?),(.*)/i)
name=RegExp.$1;city=RegExp.$2
if(RegExp.$1 && RegExp.$2)
replUR(name,city)
function goSubmit(){
formElm=document.forms["redirct"]
replUR(formElm.nm.value,formElm.ct.value)
}

function replUR(n,c){
location.replace("http://...mepage&type=basic&wie="+n+"&waar="+c)
}

</script>
</head>
<body>
<form action="#" onsubmit="goSubmit();return false" name="redirct">
Name: <input name="nm" type=text><br>
City: <input name="ct" type=text><br>
<button type="submit">Go >></button>
</form>
</body>
</html>

Mar 5 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ben | last post by:
My current project requires me to create part of a form that is created on the fly. The project consists a list of entries to an event. The name and address and such is easy. The design is detup so...
1
by: longtim | last post by:
I have been having endless difficulty creating reports/queries that set any relevent parameters from controls in forms. I am creating an application under access 2003 but will target access...
4
by: Tony | last post by:
G'day My attempt to create an MDE file was unsuccessful. The attempt produced an error that effectively said the (MDB) file was to big. The MDB consists of about 30 tables, 50 forms and 3...
5
by: Mike Turco | last post by:
What is the difference between creating relationships in the front-end vs. the back-end database? I was trying to create a relationship in a database front-end and noticed that I could not check...
8
by: Nanda | last post by:
hi, I am trying to generate parameters for the updatecommand at runtime. this.oleDbDeleteCommand1.CommandText=cmdtext; this.oleDbDeleteCommand1.Connection =this.oleDbConnection1;...
7
by: Mark Waser | last post by:
Hi all, I'm trying to post multipart/form-data to a web page but seem to have run into a wall. I'm familiar with RFC 1867 and have done this before (with AOLServer and Tcl) but just can't seem...
8
by: Oenone | last post by:
Is it possible to create an object which can have methods and properties, but which can also be treated as a string? I'm trying to create a wrapper around the IIS Request.Form object which...
0
by: negmat | last post by:
Does anyone know how exactly the sub-tree cost is calculated and whether it should be used as an indication of query/stored procedure performance? I used to think (although I could never find a...
5
by: Yash | last post by:
Hi, I am using SQL 2000 SP4. I have compared 2 scenarios: Scenario 1: insert into #bacs_report SELECT ..... WHERE <conditions>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.