Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Problem creating query string

Thread Tools

Problem creating query string
Posts: n/a
Hi guys,

im attempting to build a querystring to use in a 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')||( lue=='3'))
{'frm_PreviousAddress.aspx?PreviousSurn ame='+
document.getElementById('txt_PreviousSurname').val ue +
document.getElementById('txt_PreviousHouseName').v alue +
document.getElementById('txt_PreviousHouseNumber') .value +
document.getElementById('txt_PreviousStreetName'). value +
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',



Reply With Quote
Posts: n/a
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 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 call:
'width=600','height=400', 'top=100', 'left=200',

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.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to convert url with query string to url without query string nick Javascript 1 02-13-2011 11:20 PM
Date string problem in query string when posting back =?Utf-8?B?SnVsaWEgQg==?= ASP .Net 5 08-29-2007 02:08 PM
CGI - How to use upload_hook and query the query string ? roadrunner Perl Misc 1 02-08-2006 01:50 AM
Trying to query the Address table data of AdventureWorks database from Query Analyzer - need help! Learner ASP .Net 1 01-30-2006 08:58 PM
help with creating a mysql query string RiGGa Python 3 06-27-2004 04:11 PM