Help - Search - Members - Calendar
Full Version: Submit form on pageloaf
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
kallekula
Hi!

Is there any way to "submit" a form automaticly when a page loads?

This is my form:
CODE

<form class="template_selector" id="template_select" action="" method="post">
<input type="hidden" name="select_users_template" value="Swedish" />
<input type="image" src="images/SE.gif" />
</form>


How can I make this form "submit" without having the user click on a button (the "SE.gif")

Thanks
Kalle
Christian J
Why not run the server-side program when the page is requested by the user?
pandy
I love pageloaf. With lots of butter and cheese! biggrin.gif

Sorry - but your typo was funny! happy.gif
kallekula
QUOTE(Christian J @ Nov 1 2009, 05:03 PM) *

Why not run the server-side program when the page is requested by the user?


Sounds like a great idea. Im really a beginner when it comes to anything outside HTML/CSS.
How do I run the server-side program on pageload?

Thanks for your help!
Kalle
kallekula
QUOTE(pandy @ Nov 1 2009, 05:17 PM) *

I love pageloaf. With lots of butter and cheese! biggrin.gif

Sorry - but your typo was funny! happy.gif


Got to draw your attention in some way wink.gif
Christian J
QUOTE(kallekula @ Nov 1 2009, 11:25 PM) *

How do I run the server-side program on pageload?

You simply put it in the HTML document. Then when a user requests the page (the one where the form currently is) the program is run on the server, and the result sent to the user.

Question is how the program is going to get the data that's currently in the (hidden) form field? How did it end up there in the first place?
pandy
QUOTE(kallekula @ Nov 1 2009, 11:26 PM) *

Got to draw your attention in some way wink.gif



Pageloaf sure gets my attention. A slice of pageloaf with a bowl of steaming hot tagsoup... Yummy! laugh.gif
pandy
QUOTE(Christian J @ Nov 2 2009, 01:17 PM) *

You simply put it in the HTML document.


Are you referring to PHP now?
Christian J
QUOTE(pandy @ Nov 2 2009, 04:35 PM) *

QUOTE(Christian J @ Nov 2 2009, 01:17 PM) *

You simply put it in the HTML document.


Are you referring to PHP now?

Yes or any server-side language that can be embedded. Of course a program/script may also create a whole HTML document. The important thing is that if e.g. a browser requests an URL, a script on the server might be started (not necessarily return a web page). For example, requesting the URL to this very topic: http://forums.htmlhelp.com/index.php?showtopic=10096 makes the forum script create it on the fly.
kallekula

You simply put it in the HTML document.
[/quote]

Are you referring to PHP now?
[/quote]
Yes or any server-side language that can be embedded. Of course a program/script may also create a whole HTML document. The important thing is that if e.g. a browser requests an URL, a script on the server might be started (not necessarily return a web page). For example, requesting the URL to this very topic: http://forums.htmlhelp.com/index.php?showtopic=10096 makes the forum script create it on the fly.
[/quote]

Okey. Since Im really unfamiliar with php or likewise I would be glad for an code-example on how I do this.

Thanks again for your help
Kalle
Christian J
QUOTE(kallekula @ Nov 2 2009, 07:09 PM) *

Okey. Since Im really unfamiliar with php or likewise I would be glad for an code-example on how I do this.

Like http://www.php.net/manual/en/tutorial.firstpage.php ? unsure.gif

But again, how is the program going to get the data ("Swedish" in your example) that's currently in the (hidden) form field? The user or his browser must supply it in some way.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.