Pass values from FORM fields to another page without a SUBMIT action 
Author Message
 Pass values from FORM fields to another page without a SUBMIT action

Hi,

I want to pass values from some (hidden) FORM fields to another page. I
don't have any SUBMIT button or hyperlink on my page so everything must
happen automatically. I'm using ASP and VBScript. The script I'm using now
is:

<form name="form" action="anotherpage.asp">
<input type=hidden  name="bguide" value="<% response.write(guide) %>">

</form>
<%
document.form.submit()
%>

I don't get any error message. Just nothing happens. "Anotherpage" is NOT
started.

Frank



Sun, 07 Sep 2003 03:31:00 GMT  
 Pass values from FORM fields to another page without a SUBMIT action
Frank,
I can't imagine what exactly you are after, but have you tried this :

<html>
<body>
<form name="form" action="anotherpage.asp" method="post">
<input type=hidden  name="bguide" value="<% response.write(guide) %>">
</form>
<script>
document.form.submit();
<script>
</body>
</html>

Regards,
George.


Quote:
> Hi,

> I want to pass values from some (hidden) FORM fields to another page. I
> don't have any SUBMIT button or hyperlink on my page so everything must
> happen automatically. I'm using ASP and VBScript. The script I'm using now
> is:

> <form name="form" action="anotherpage.asp">
> <input type=hidden  name="bguide" value="<% response.write(guide) %>">

> </form>
> <%
> document.form.submit()
> %>

> I don't get any error message. Just nothing happens. "Anotherpage" is NOT
> started.

> Frank



Sun, 07 Sep 2003 04:15:01 GMT  
 Pass values from FORM fields to another page without a SUBMIT action
Thanks George!

It works okay now.

I noticed that it is not possible to use the BACK button of the browser. I
like this because it prevents data from being send twice. Is there a special
why this is not possible?

Frank



Quote:
> Frank,
> I can't imagine what exactly you are after, but have you tried this :

> <html>
> <body>
> <form name="form" action="anotherpage.asp" method="post">
> <input type=hidden  name="bguide" value="<% response.write(guide) %>">
> </form>
> <script>
> document.form.submit();
> <script>
> </body>
> </html>

> Regards,
> George.



> > Hi,

> > I want to pass values from some (hidden) FORM fields to another page. I
> > don't have any SUBMIT button or hyperlink on my page so everything must
> > happen automatically. I'm using ASP and VBScript. The script I'm using
now
> > is:

> > <form name="form" action="anotherpage.asp">
> > <input type=hidden  name="bguide" value="<% response.write(guide) %>">

> > </form>
> > <%
> > document.form.submit()
> > %>

> > I don't get any error message. Just nothing happens. "Anotherpage" is
NOT
> > started.

> > Frank



Sun, 07 Sep 2003 05:44:57 GMT  
 Pass values from FORM fields to another page without a SUBMIT action
Frank,

Interesting... I have not tried this idea before so I have not noticed this
behavior. I came up with the solution directly in your example without even
testing it. I would guess that it may be caused from the submit action which
does not create a history, I do not know. Normally I am using different
approach to prevent posting the data twice and in the same time giving the
user the possibility to go back/forward in the history. I have ASP pages
without any HTML tags just to do the action on the database and then
redirect the browser to the normal page to display the result for the
client. One can do this by either have another SQL query if necessary to
display data from a database, or assign in the database action ASP page all
the values in an session array variable for example and then in the ASP page
that will display the data for the client just display the SQL query or the
session array variable. This way the browser does not know for the hidden
ASP page that does only the action on the database and when the user moves
back/forward it does not do the database action (save, delete, update for
example).

Hope I was clear.
Regards,
George.


Quote:
> Thanks George!

> It works okay now.

> I noticed that it is not possible to use the BACK button of the browser. I
> like this because it prevents data from being send twice. Is there a
special
> why this is not possible?

> Frank



> > Frank,
> > I can't imagine what exactly you are after, but have you tried this :

> > <html>
> > <body>
> > <form name="form" action="anotherpage.asp" method="post">
> > <input type=hidden  name="bguide" value="<% response.write(guide) %>">
> > </form>
> > <script>
> > document.form.submit();
> > <script>
> > </body>
> > </html>

> > Regards,
> > George.



> > > Hi,

> > > I want to pass values from some (hidden) FORM fields to another page.
I
> > > don't have any SUBMIT button or hyperlink on my page so everything
must
> > > happen automatically. I'm using ASP and VBScript. The script I'm using
> now
> > > is:

> > > <form name="form" action="anotherpage.asp">
> > > <input type=hidden  name="bguide" value="<% response.write(guide) %>">

> > > </form>
> > > <%
> > > document.form.submit()
> > > %>

> > > I don't get any error message. Just nothing happens. "Anotherpage" is
> NOT
> > > started.

> > > Frank



Sun, 07 Sep 2003 16:08:12 GMT  
 Pass values from FORM fields to another page without a SUBMIT action
If you pop up the window it has access to all of the document elements
from the page that opened it.  Use the opener property. (I belive that
it is window.opener

On Tue, 20 Mar 2001 22:15:01 +0200, "George G."

Quote:

>Frank,
>I can't imagine what exactly you are after, but have you tried this :

><html>
><body>
><form name="form" action="anotherpage.asp" method="post">
><input type=hidden  name="bguide" value="<% response.write(guide) %>">
></form>
><script>
>document.form.submit();
><script>
></body>
></html>

>Regards,
>George.



>> Hi,

>> I want to pass values from some (hidden) FORM fields to another page. I
>> don't have any SUBMIT button or hyperlink on my page so everything must
>> happen automatically. I'm using ASP and VBScript. The script I'm using now
>> is:

>> <form name="form" action="anotherpage.asp">
>> <input type=hidden  name="bguide" value="<% response.write(guide) %>">

>> </form>
>> <%
>> document.form.submit()
>> %>

>> I don't get any error message. Just nothing happens. "Anotherpage" is NOT
>> started.

>> Frank



Wed, 10 Sep 2003 03:57:58 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. What fires the submit action of a form without a submit button

2. passing a form field value from a page to a frame's page

3. passing fields from form to form, and handling a date field

4. Hidden field in form not retaining it's value after submit

5. Get form input field value before submit?

6. Submitting Form WITHOUT Submit Button

7. Submitting form without submit button...

8. Submitting Form WITHOUT a Submit Button

9. Submitting form without submit button...

10. passing multiple values from an HTML page to a single parameter field

11. trying to hand submit a form, but it has no ACTION

12. Passing values between pages using a form

 

 
Powered by phpBB® Forum Software