473,563 Members | 2,695 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Submitting a form results in a blank page

1 New Member
i m submitting (posting) a form to some external site url . By clicking on submit it opens up new window (target='_blank ' set) and my form is submitted there. but if i tries to submit a form using java script by using document.form_n ame.submit; then new window is opened but i m not getting results.

example:

Expand|Select|Wrap|Line Numbers
  1. <meta http-equiv="refresh" content="10"  /> 
  2. <script language="javascript">
  3.     function submit_form()
  4.     {
  5.         document.form1.submit();    
  6.     }
  7. </script>
  8. <?
  9. $no=rand(12,500000);
  10. //echo $no;
  11. ?>
  12.     <form name="form1" method="post" action="http://www.example.com/175942.php" target="_blank">
  13.  
  14.         <input name="txtName" type="text" id="txtName" value="CPPPPPPPPP<?=$no?>   hello">
  15.         <input name="txtName1" type="text" id="txtName1" maxlength="100" value="CCCCCCCCCCPPPPPPPPPP<?=$no?> (NEHA)">
  16.         <input name="txtName2" type="text" id="txtName2" maxlength="100" value="DIVYAAAAAAAAAA (CP)<?=$no?>">
  17.         <input name="txtName3" type="text" id="txtName3" maxlength="100" value="HIIIIIIIIIIII CCCCCCCCCCPPPPPPPPPP<?=$no?>">
  18.         <input name="btnSubmit" type="submit" id="btnSubmit"  onclick="submit_form()" value="Click to find out!"></td>
  19.  
  20. <script language="javascript">
  21. document.form1.submit();
  22. </script>
  23.  
  24.  
  25.     </form>
Sep 20 '07 #1
2 3599
dmjpro
2,476 Top Contributor
i m submitting (posting) a form to some external site url . By clicking on submit it opens up new window (target='_blank ' set) and my form is submitted there. but if i tries to submit a form using java script by using document.form_n ame.submit; then new window is opened but i m not getting results.

example:

Expand|Select|Wrap|Line Numbers
  1. <meta http-equiv="refresh" content="10"  /> 
  2. <script language="javascript">
  3.     function submit_form()
  4.     {
  5.         document.form1.submit();    
  6.     }
  7. </script>
  8. <?
  9. $no=rand(12,500000);
  10. //echo $no;
  11. ?>
  12.     <form name="form1" method="post" action="http://www.example.com/175942.php" target="_blank">
  13.  
  14.         <input name="txtName" type="text" id="txtName" value="CPPPPPPPPP<?=$no?>   hello">
  15.         <input name="txtName1" type="text" id="txtName1" maxlength="100" value="CCCCCCCCCCPPPPPPPPPP<?=$no?> (NEHA)">
  16.         <input name="txtName2" type="text" id="txtName2" maxlength="100" value="DIVYAAAAAAAAAA (CP)<?=$no?>">
  17.         <input name="txtName3" type="text" id="txtName3" maxlength="100" value="HIIIIIIIIIIII CCCCCCCCCCPPPPPPPPPP<?=$no?>">
  18.         <input name="btnSubmit" type="submit" id="btnSubmit"  onclick="submit_form()" value="Click to find out!"></td>
  19.  
  20. <script language="javascript">
  21. document.form1.submit();
  22. </script>
  23.  
  24.  
  25.     </form

Welcome to TSDN.
Use Code Tags while you do Post.
I think for secured reasons it is not happening.
Do you know the JavaScript does not support Cross-Site Scripting?
It does not.

Kind regards,
Dmjpro.
Sep 20 '07 #2
pbmods
5,821 Recognized Expert Expert
Heya, Vikasbatra. Welcome to TSDN!

Please use CODE tags when posting source code:

[CODE=javascrip t]
JavaScript code goes here.
[/CODE]

Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

If you're getting a blank page, your script is probably generating an error. Check out this article to find out what is going on.
Sep 20 '07 #3

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

Similar topics

1
4180
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens in IE as well as FireFox. This code has been tested on a Win2003 server, IIS6, PHP 5.0.3, mySQL 4.1.8 and it works fine. The problem server is...
8
5081
by: dmcconkey | last post by:
Hi folks, I have a client with four websites. Each site has a contact form that is identical. They all have "required" fields validated through a JavaScript onSubmit() function. Upon validation, post values go to a PHP processing page that adds values to a database and generates an email to someone in marketing. For three of these sites,...
2
2620
by: Scott | last post by:
Hi, I hope someone might be able to set me straight on how to handle the situation described below. I have a page that has an email field for user input and 2 radio buttons (subscribe + unsubscribe) for signing up to a mailing list. What I would like to have happen is the following: The user enters an email and presses the submit...
2
2212
by: Greg T | last post by:
Hi, I have a rather long form that I don't want people submitting unless they are absolutely sure they are ready. I figured the easiest way to prevent an accidental form submission by way of hitting of the enter key was to simply not have a submit button, instead going for a regular anchor which calls a javascript confirmation box and...
5
4592
by: Tyler Style | last post by:
Hullo - looking for a little advice here. I have a form on a page in one domain submitting to a cgi in another domain. Weirdly, on some Windows XP systems, a form on the page fails to submit/post properly to the cgi and users get the message from IE that it "Cannot find server: The page cannot be displayed The page you are looking for is...
4
7074
by: Al Cadalzo | last post by:
I'm trying to simulate a form post (i.e. Method="POST"). The FORM POST I'm trying to simulate is similar to this: <FORM NAME=SearchForm METHOD=POST ACTION=Search> <SELECT name="criteriaA" > <OPTION VALUE=1>AAAAAAAAAAA</OPTION> <OPTION VALUE=2>BBBBBBBBBBBB</OPTION> </SELECT> ....
1
1520
by: Hello | last post by:
Scenario: A page creates a pop up and that pop up submits a form. Is there a way to detect whether the submitting was successful or not, so true/false could be passed to the parent window?
6
1229
dmjpro
by: dmjpro | last post by:
here is my code ...... <html> <head> <title>Simple Test</title> <script language = javascript> function test() { if(document.all.txt.value == '')
7
3592
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
0
7885
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. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7638
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...
0
6250
agi2029
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...
1
5484
isladogs
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...
0
5213
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...
0
3642
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...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
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.