How to handle form submissions?
How to handle form submissions?
Hi there,
I would like to handle a form submission so that tthe handling code is displayed inside my cmsimple template. I am using hd_pd_scripting plugin to let me exdcute my own php code in my pages. The first page has the form HTML in it, but I don't kmow what to set the <form action> to? If I action it to a file.php the loaded page won't be inside the nice cmsimple page template.
I have tried no action value, and also tried the URL of the cmsimple page that I want to handle the form but none of it works.
Please help! I'm stuck!
I would like to handle a form submission so that tthe handling code is displayed inside my cmsimple template. I am using hd_pd_scripting plugin to let me exdcute my own php code in my pages. The first page has the form HTML in it, but I don't kmow what to set the <form action> to? If I action it to a file.php the loaded page won't be inside the nice cmsimple page template.
I have tried no action value, and also tried the URL of the cmsimple page that I want to handle the form but none of it works.
Please help! I'm stuck!
Re: How to handle form submissions?
I tested it once on a tespage:
1. having external file calling it into an iframe on a regular internal page, then the action is not necessary or may be directed on the file self.
- here I had the myfile.php file with form in the root.
- the code on the page was
- the myfile.php had this code
-DONT FORGET that any styling shall be dropped in the file or properly linked.
2. the other way is placing the form into a newsbox (again, the relevant page is content.htm, so IMHO any redirection is redundant).
3. third way now is using Holger's fancybox plugin.
1. having external file calling it into an iframe on a regular internal page, then the action is not necessary or may be directed on the file self.
- here I had the myfile.php file with form in the root.
- the code on the page was
Code: Select all
<p><iframe style="margin: 0; padding: 0; border: none; width: 520px; height: 310px;" src="http://myURL/myfile.php" width="320" height="240"></iframe></p>
Code: Select all
<form id="myform" name="myform" method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF'];?>">
Code: Select all
<style>
@media all and(max-width:420px){
table.box_left, table.box_right{width: 100px;} /*make sure, that the form will fit to narow devices. there is no need wor very width forms. */
}
</style>
2. the other way is placing the form into a newsbox (again, the relevant page is content.htm, so IMHO any redirection is redundant).
3. third way now is using Holger's fancybox plugin.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: How to handle form submissions?
Thank you for your advice. I used an iframe and it seems to work well enough.
Just for future reference I will document what I did here:
Create a normal php file that handles the form data (and/or lack thereof)
Use the iframe tag as shown above to load the php code into the cmsimple page
The iframe basically operates like a seperate page to that generated by cmsimple, so as said above, the styling cmsimple has will not exist in what the iframe does.
Pros: easy if you are used to using individual html/php files to handle forms
Cons: styling doesnt get used, iframe exists in a fixed size element on the page unless you use ssome javascript to automatically resize it (I couldn't get it to work)
I will probably do a more detailed breakdown of what I did and put it on my website. If I do I will edit and link here.
Just for future reference I will document what I did here:
Create a normal php file that handles the form data (and/or lack thereof)
Use the iframe tag as shown above to load the php code into the cmsimple page
The iframe basically operates like a seperate page to that generated by cmsimple, so as said above, the styling cmsimple has will not exist in what the iframe does.
Pros: easy if you are used to using individual html/php files to handle forms
Cons: styling doesnt get used, iframe exists in a fixed size element on the page unless you use ssome javascript to automatically resize it (I couldn't get it to work)
I will probably do a more detailed breakdown of what I did and put it on my website. If I do I will edit and link here.
Re: How to handle form submissions?
how about to usse iframe dimension expressed in %? And use inline style for iframe?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: How to handle form submissions?
I used % for the iframe width, but couldn't get the height to auto adjust. I don't know much about styling webpages. Mainly just php.
Re: How to handle form submissions?
Perhaps this will help: Fluid iframe Responsive iFramesCatfish wrote:I used % for the iframe width, but couldn't get the height to auto adjust.
As an alternative to the iframe, could be the plugin GXGetUrl, see also Thread.
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“ Ludwig's XH-Templates for MultiPage & OnePage
Re: How to handle form submissions?
Ludwig wrote:Perhaps this will help: Fluid iframe Responsive iFramesCatfish wrote:I used % for the iframe width, but couldn't get the height to auto adjust.
As an alternative to the iframe, could be the plugin GXGetUrl, see also Thread.
I agree with Ludwig on these options. You want to make sure the forms are responsive. Keep them minimal, and whenever you can, incorporate auto-fill. Otherwise you are looking at people abandoning the form if it's long and complex. What kind of site is this form for?
Re: How to handle form submissions?
I have found these hints on internet. But they don't work on my webpage. Using codes:
results after saving in
Code: Select all
/* IFRAME */
.fluidMedia {
position: relative;
padding-bottom: 56.25%; /* proportion value to aspect ratio 16:9 (9 / 16 = 0.5625 or 56.25%) */
padding-top: 30px;
height: 0;
overflow: auto;
}
.fluidMedia iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
Code: Select all
<div class="fluidMedia"><iframe src="./gallery" frameborder="0"></iframe></div>
Code: Select all
<div class="fluidMedia"><iframe src="./gallery" frameborder="0" width="320" height="240"></iframe></div>
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: How to handle form submissions?
Tata, find a solution already for the fluidmedia coding??
Re: How to handle form submissions?
width = "320" height = "240" that are the default values of TinyMCE, automatically entered when no information was given to width and height.
Not interfere with these values, they are overwritten by the responsive iFrame.
Also helpfull, richu's Tutorial "Anleitung ein YouTube Video responsive in Ihre eigene Webseite einzubinden."
An alternative would be the CKEditor.
BTW @Holger: Is this maintained even further?
Not interfere with these values, they are overwritten by the responsive iFrame.
Also helpfull, richu's Tutorial "Anleitung ein YouTube Video responsive in Ihre eigene Webseite einzubinden."
An alternative would be the CKEditor.
BTW @Holger: Is this maintained even further?
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“ Ludwig's XH-Templates for MultiPage & OnePage