473,809 Members | 2,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

opening a new window

11 New Member
Heya all, I want to know how to pass a variable across when opening a new window using javascript.
Ive got a text field and a button-and by changing properties of the button i can get it to open up a new window- however i want to know how i can pass the text field value so it appears in my pop-up window

Heres my code- im using asp


Expand|Select|Wrap|Line Numbers
  1. <tr> 
  2. <td colSpan="5"><strong><font face="Arial" size="2">Search Criteria:</strong></td>
  3.  
  4. <td><input type="text" name="GSearch" </font></strong></td>
  5.  
  6. <td colSpan="20">
  7. <INPUT TYPE="RADIO" NAME="DB" VALUE="1" CHECKED>Suppliers
  8. </p>
  9.  
  10. <INPUT TYPE="RADIO" NAME="DB" VALUE="2" >Members 
  11. </td>
  12.  
  13. <td>
  14. <td colSpan="10"><input type="submit" name="submit" value="Submit" align="right" onClick="window.open
  15. ('Search Results.asp','mywindow','width=600,height=400')">
  16. </td>
  17. </tr>
thanks
Feb 7 '07
12 2548
new214
11 New Member
there is abit of a problem, ive done what u said- however- when im selecting either radio button it only send the value 1. Whether i select the first radio button or the second it only passed the value 1???

Heres my input button code:-

Expand|Select|Wrap|Line Numbers
  1. <table border="1" width="100%" bgColor="#3380b2" border="0" cellSpacing="2" cellPadding="2">
  2. <tr> 
  3.     <td colSpan="5"><strong><font face="Arial" size="2">Search Criteria:</strong></td>
  4.  
  5.     <td><input type="text" name="GSearch" id="GSearch"></font></strong></td>
  6.  
  7.     <td colSpan="20"><INPUT TYPE="RADIO" NAME="DB1" id="DB1" VALUE="1" CHECKED>Suppliers</td>      
  8.     </p>          
  9.     <td colSpan="20"><INPUT TYPE="RADIO" NAME="DB1" id="DB1" VALUE="2">Members</td>
  10.  
  11.  
  12.  
  13. <td>
  14.  
  15. <input type="submit" name="submit" value="Submit" align="right" onClick="window.open
  16. ('Search Results.asp?Search='+document.getElementById('GSearch').value+'&DB1='+document.getElementById('DB1').value, 'mywindow','width=600,height=600')">
  17.  
  18. </td>


And heres how i am requesting this

Expand|Select|Wrap|Line Numbers
  1. H = (Request.QueryString("Search"))
  2. B = (Request.QueryString("DB1"))
If it also helps- ive also looked at this way of requeting my radio buttons:-

Expand|Select|Wrap|Line Numbers
  1. B= Request.Form("DB")
  2.  
  3. if B="1" then 
  4. Response.Write("1")
  5.  
  6. else
  7. Response.Write("2")
  8. end if
However it Is not working- this time it only prints out 2 even though ive selected the first radio button- the the exact opposite of the first problem- not sure why?

Any suggestions??
Feb 14 '07 #11
new214
11 New Member
Ive got it sorted - thanks to all- all i did was create a script and feed all the information to the script so that it opens the link from the script which enabled me to send the info to the next page
Feb 14 '07 #12
acoder
16,027 Recognized Expert Moderator MVP
Ive got it sorted - thanks to all- all i did was create a script and feed all the information to the script so that it opens the link from the script which enabled me to send the info to the next page
Glad you got it sorted. I was about to suggest that you set the target of your form to the new open window and let the GET method pass the values automatically, but you got it working anyway. The Javascript method of getting the selected value from a radio button requires looping through the radio buttons.
Feb 14 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

2
7045
by: Dena Leiter | last post by:
I want to send people to a new page using a redirect but I want a new window to open. Is this possible? I've tried this: <meta http-equiv="refresh" content="0;url=http://search.epnet.com/direct.asp?jn=HBR&db=bch target=_blank"> but it doesn't open a new browser window. Is there a way to do this?
44
4749
by: Carlos Andr?s | last post by:
Hi everybody. I've got a problem. I'd like to avoid opening a new window when you have pressed the shift key and you click in the left button of the mouse. I've tried the next solution, in the body of the page I put the next code: <BODY onkeydown='notOpenNewWindow();'>
14
11105
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin = window.open('images/KJV-THANKS.gif', 'Thanks', 'width=243,height=420,'); cwin.focus();
2
1792
by: Keshav Gadia | last post by:
Hi, I am an ASP.net newbie. I am writing a user control that is made up of datagrid with one of the columns opening a new window to display some details on click of the set image. I have basically used ImageButton server control. The problem is because I have used a server control with runat="server",the parent page is posted back and even though the window opens up,the focus gets set to the parent window. What I want is,the new window...
5
2165
by: Roger Withnell | last post by:
This is a framed webpage with the navigation bar in "NavBar" and the main window in "Main". When opening a new page in "Main" from "NavBar" with: function OpenFrameWindow(src) { var NewWindow = window.open(src, "Main"); NewWindow.focus(); }
3
2138
by: Larry Bud | last post by:
Wanting to use a technology I saw for one of our apps. We have several apps that a user logs in at on the same page. The app is determined by a drop down. User credentials are checked, response.redirect to the application. The user ID is stored in a session variable which determines if the user is logged in. When the session var goes blank, the user is redirected to the login page. A header on each page checks this. Now, some...
3
2669
by: Bonzol | last post by:
Vb.Net 2003, 1.1. Web application. Hey there I have this, Response.Redirect("FileFiew.aspx") to go to a new page, but how do I open that page in a new window? So I will have 2 pages open,, the original page, and the page I opened.
1
11080
by: sandy21380 | last post by:
Hello, Is there a way of opening an Access form without opening the Access window? Right now when I open the form, the Access window is a lot bigger than the form so I have to resize the Access window so it doesn't take up my whole screen (the form is about 2" x 3"). If there is no way to open only the form without the Access window opening, is there a way to automatically set the size of the Access window and close the menu bar?\ Thanks!
1
1764
by: coolsidsin | last post by:
I have a apsx form (Form A), which on submiting does a time consuming task. So i want to open a new aspx window (Form B) in which I want do do that time consuming task and show progress to the user and while that task is being completed I want Form A to redirect to Form C. I opened form B in a new javascript window and updated the progress through ajax but Form A doesn't let me redirect to Form C unless Form B's processing is Completed. ...
0
2027
by: bbrewder | last post by:
I am struggling with some MSAccess automation issues. Basically, we have a .Net application that uses MSAccess for reporting (legacy code). We are able to launch MSAccess fine and even work with the MSAccess COM objects to run our reports (using GetObject(<MDB Path>) - see http://support.microsoft.com/default.aspx?scid=kb;en-us;317113&Product=vbNET for info on how to do this). The problem that we are running into is that if our Access...
0
9603
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10643
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10391
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10121
tracyyun
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6881
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4333
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
2
3862
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.