473,545 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.getEle mentById('txt_T imeAtAddress');
if ((txtAd.value== '1')||(txtAd.va lue=='2')||(txt Ad.value=='3'))
window.open('fr m_PreviousAddre ss.aspx?Previou sSurname='+
document.getEle mentById('txt_P reviousSurname' ).value +
'&PreviousHouse Name='+
document.getEle mentById('txt_P reviousHouseNam e').value +
'&PreviousHouse Number='+
document.getEle mentById('txt_P reviousHouseNum ber').value +
'&PreviousStree tName='+
document.getEle mentById('txt_P reviousStreetNa me').value +
'&PreviousTownL and='+
document.getEle mentById('txt_P reviousTownland ').value +
'&PreviousTown= '+ document.getEle mentById('txt_P reviousPostTown ').value
+ '&PreviousPostC ode='+
document.getEle mentByID'txt_Pr eviousPostcode' ).value ,'', 'width=600',
'height=400', 'top=100', 'left=200', 'menubar=no',
'resizable=no') ;



Aug 11 '05 #1
1 1347
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

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','he ight=400', 'top=100', 'left=200',
'menubar=no','r esizable=no'

This should infact be:
'width=600,heig ht=400,top=100, left=200,menuba r=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

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, DOSMBK. FROM DOSMBK WHERE (((DOSMBK.Date)<#19/04/2004#) AND ((DOSMBK.)="M9S" Or (DOSMBK.)="M9SA") AND ((DOSMBK.From)=#06/09/2004#)); If I view this...
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 user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which...
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 works fine, but passing the resulting recordset back to the sub's caller is not working out.
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 text boxes on it and a command button bound to a macro which fires off a parameter query based on the criteria/string that the user types into the...
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 solution here - until now. This one is driving me crazy. I am making my first attempt at creating a runtime application. I am using Access 2003...
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 way to create a single query that will take parameters if they are present in the text boxes and not take parameters if the text box is empty? The...
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 the Main() function: // if this is not the first instance of this application, exit // immediately. Allow only one instance in the system if...
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 left, I always see that there are 2 connections open and in "ESTABLISHED" state. Here is the piece of code that I'm using, please tell where I'm...
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 However, I had to change the Data Type of one of my fields ("ArticleID") from a number to text. Now, the query doesn't work, and I know it's because of the...
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 creating a new profile. My dilemma is this, I don't know what part of the profile was creating the problem, so I don't know if it will reappear? ...
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.