471,873 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 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 +
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',



Aug 11 '05 #1
1 1300
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','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.

Aug 11 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Peter Bailey | last post: by
3 posts views Thread by dskillingstad | last post: by
4 posts views Thread by DeanL | last post: by
5 posts views Thread by Usman Jamil | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

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.