473,321 Members | 1,669 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,321 software developers and data experts.

How can I make the document.formname.submit() to open in a new window?

mikek12004
200 100+
Upon clicking on a link I want to go to another page with lots of data (which I do not wish to pass through GET so I used post like this)
the links is
Expand|Select|Wrap|Line Numbers
  1. <a onClick="display1(1)" onMouseOver="this.style.cursor='pointer'" class="a3" >click here</a>
and just above
Expand|Select|Wrap|Line Numbers
  1. <form name="f1" id="f1" method="post" action="http://127.0.0.1/dome/main.php?page=69">
  2. <input type="hidden" name="info" id="info"  value=""/> 
  3. </form>
  4.  
  5. <script type="application/javascript">
  6. function display1(num)
  7. {
  8.     if (num=='1')
  9.     {
  10.         document.f1.info.value='PA0720001|02861|02875|02708|02708|PA0720004|PA0720005|PA0720006|11114002169|11114002143|11114004269|11114004249|11114004229|11114000103|11114001109|11115002169|11125002169|BTT0000006|BTT0000005';
  11.     }
  12.     else if (num=='2')
  13.     {
  14.         document.f1.info.value='BTT0000005';
  15.     }
  16.     else if (num=='3')
  17.     {
  18.         document.f1.info.value='BTT0000006|02708';
  19.     }
  20.     //document.f1.action='';
  21.     document.f1.submit();
  22. }
  23. </script>
  24.  
but it opens in the same page and not in a new one as I want any help?
Dec 30 '09 #1
6 2469
Dormilich
8,658 Expert Mod 8TB
but it opens in the same page and not in a new one as I want any help?
why should it open in a new page?
Dec 30 '09 #2
mikek12004
200 100+
I do not want to lose the previous page (think of it as a page of contents from which the user clicks various links)
Dec 30 '09 #3
Dormilich
8,658 Expert Mod 8TB
then the only thing coming to my mind is window.open(), you may be able to pass something through window.opener.
Dec 30 '09 #4
acoder
16,027 Expert Mod 8TB
Try the target attribute. You can add it with JavaScript if you want.
Dec 30 '09 #5
mikek12004
200 100+
try the target attribute in js
Tried to put it directly in the <a> tag didn't do anything, haven't tried to put it through js but probably will have the same effect
Dec 31 '09 #6
acoder
16,027 Expert Mod 8TB
Add it to the form, not to the link
Dec 31 '09 #7

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

Similar topics

2
by: Miles Davenport | last post by:
My Javascript is rather rusty :( ... and I need to do change some form values, in the folowing way: (1). I have the following a href (wrapped in PHP), which calls processForm. ==== <input...
3
by: Don | last post by:
I can successfully force submission of a <form> using "document.formname.submit()". But, the submission doesn't appear to occur when used with Netscape. Anybody know why this is happening, and...
6
by: skubik | last post by:
Hi everyone. I'm attempting to write a Javascript that will create a form within a brand-new document in a specific frame of a frameset. The problem is that I can create the form and input...
7
by: michael | last post by:
apologies in advance, as not only am i new to learning how to code javascript properly, i'm new to the groups posting thing... i am developing in firefox 1.0+, but will be working in an msie 6.0+...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
5
by: drdave | last post by:
Hi, I have 6 forms being generated using coldFusion, they are named special1, special2 special3 and so on.. in these forms I have a link to open a new window. I am trying to pickup the...
7
by: vinsim24 | last post by:
Hi all, the code where i am finding a problem is as follows: <html> <head> <script> function fun1(){ window.document.formName.action="/someServlet"; window.document.formName.submit();
23
by: Stanimir Stamenkov | last post by:
<form name="myForm" action="..."> <p><input type="text" name="myElem"></p> </form> As far as I was able to get the following is the standard way of accessing HTML form elements: ...
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
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.