473,326 Members | 2,175 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,326 software developers and data experts.

Problem creating query string

Hi guys,

im attempting to build a querystring to use in a window.open to display
a popup box.

Unfortunately im quite new to javascript and find it quite difficult to
get this functioning correctly.

Would someone please have a look and point out any of my glaring
mistakes. im a bit stuck.

Thanks in advance

function PrevAddress()
{
var txtAD;
txtAd = document.getElementById('txt_TimeAtAddress');
if ((txtAd.value=='1')||(txtAd.value=='2')||(txtAd.va lue=='3'))
{
window.open('frm_PreviousAddress.aspx?PreviousSurn ame='+
document.getElementById('txt_PreviousSurname').val ue +
'&PreviousHouseName='+
document.getElementById('txt_PreviousHouseName').v alue +
'&PreviousHouseNumber='+
document.getElementById('txt_PreviousHouseNumber') .value +
'&PreviousStreetName='+
document.getElementById('txt_PreviousStreetName'). value +
'&PreviousTownLand='+
document.getElementById('txt_PreviousTownland').va lue +
'&PreviousTown='+ document.getElementById('txt_PreviousPostTown').va lue
+ '&PreviousPostCode='+
document.getElementByID'txt_PreviousPostcode').val ue ,'', 'width=600',
'height=400', 'top=100', 'left=200', 'menubar=no',
'resizable=no');
}
}

Regards

CG

Aug 11 '05 #1
1 1330
Firstly, just a little tip.
It is much easier to find issues with such strings, if you use a
variable to hold the string while building it, and then add the
variable as an url-parameter into your window.open function :)
This would also mean you could alert the string and see how it looks
easily.

However - as for your question, then I think the problem is infact with
the latter part of your parameter list in your window.open call:
'width=600','height=400', 'top=100', 'left=200',
'menubar=no','resizable=no'

This should infact be:
'width=600,height=400,top=100, left=200,menubar=no,resizable=no'
That is a string of parameters seperated by commas, not a comma
seperated list of parameters.
Could be there your issue is burried and not with the actual url, which
to me looks allright.

Hope this helps.

Aug 11 '05 #2

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

Similar topics

4
by: Peter Bailey | last post by:
I have a vba string taht dynamically creates the query which has two dates in it that it grabs off an open form as a string from the textbox. What I generate in vba is: SELECT DOSMBK.Date,...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
6
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query...
3
by: dskillingstad | last post by:
I'd appreciate any help I can get. I'm not sure what I'm doing wrong, but.... I've searched these groups for some solutions but no luck. I have an unbound form (frmSearch), with several unbound...
13
by: Lee | last post by:
Hello All, First of all I would like to say thank you for all of the help I have received here. I have been teaching myself Access for about 4 years now and I've always been able to find a...
4
by: DeanL | last post by:
Hi Guys, I need some help creating a query that is going to take between 1 and 10 parameters. The parameters are entered on a form into text boxes that may have data or be empty. Is there a...
5
by: Benzi Eilon | last post by:
I have written a C# application which should run as a Windows Service. I must avoid having multiple instances of the application on one machine so I inserted the following code at the beginning of...
5
by: Usman Jamil | last post by:
Hi I've a class that creates a connection to a database, gets and loop on a dataset given a query and then close the connection. When I use netstat viewer to see if there is any connection open...
6
by: mforema | last post by:
Hi Everybody, I have a function that worked perfectly when it was used in a query. I received help in creating this function from this discussion: Help with Query and Subform - post #18 ...
4
Claus Mygind
by: Claus Mygind | last post by:
I have a problem with some ajax communications on some users' computers. Sometimes data sent via ajax would not post to the database. I resolved the problem by deleting the user's profile and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.