Jump to content

iframe to display form


vijdev

Recommended Posts

I wouldn't think there is a need for use of an iframe. What you could do is a mixture of JS/jQuery and PHP.

 

When user submits form, the form is then hidden and a container which houses a Thank You message is then shown.

 

http://www.raymondselda.com/php-contact-form-with-jquery-validation/

 

The above is a nice tutorial and basically in this bit:

 

<?php if(isset($emailSent) && $emailSent == true) { ?>

 

<?php } ?>

 

You could put JavaScript to trigger a function that hides the form and shows your message :)

 

Try and stay away from iframes, they are horrible things!

Link to comment
Share on other sites

the thing is am still a sub-novice at jquery or any ajaxy things..

so was wondering abt iframes...

i know ajax is the ultimate final destination.

any alternatives until then?..why do you say NO to iframes?..is it so dangerous and messy?

 

and if not ajax and if not iframes..anything else?

Link to comment
Share on other sites

No AJAX is required and nor are iFrames.

 

Basically you have a hidden container div, that contains your thank you message.

 

When user posts the form, the mail is sent etc, then you simply Hide your form with jQuery/JavaScript and then show the thank you div.

 

Have a look at the link I posted above, it should give you a good understanding.

Link to comment
Share on other sites

Using frames is not secure. Why don't you just change the .HTML page extension to .PHP and combine the form into the current page by simply embedding the PHP code or give it the same style sheet as the rest of your site and designate the form as a separate page.

 

You can even include the form with PHP if you change the page extension from .HTML to . PHP, then just include an echo in the bottom of the PHP form:

 

<?PHP 

include('your-form-page.php');

echo 'Thanks for using this form!';
?>

 

Keep in mind that most people don't have a 1400x1200 wide screen resolution when they browse the Internet thanks to phones and hand-held devices that can browse the internet, so you want to keep forms on separate pages anyway.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.