Contact form completion

Text replace question

Page 1 of 1

1 Replies - 584 Views - Last Post: 26 February 2010 - 11:32 PM Rate Topic: -----

#1 AUAN  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 91
  • Joined: 30-July 09

Contact form completion

Posted 26 February 2010 - 06:52 PM

Hey all, I am coding a small email form for the frontpage of this site and I am wondering if something I am wanting to do is possible.

Html:
   <div id="contact-area">
		   <label id="title" for="Name">Sign Up for the Mail list!</label>
			<form name="contactform" method="post" action="contactengine.php">
				<label for="Name">name</label>
				<input type="text" name="Name" id="Name" />
				
		    	<label for="Email">email</label>
				<input type="text" name="Email" id="Email" />
				
                <p><a href="javascript: submitform()">submit</a></p>
			</form>
				
				<script type="text/javascript">
					function submitform()
					{
 						document.contactform.submit();
					}
				</script>
            
			<div style="clear: both;"></div>
    </div>



Now what I am wanting to try and attempt is that when the a user enters their name and email address and clicks submit, instead of taking them to totally new page usually "thanks.php" or something like that, to just replace the contact form with a div containing some text saying "Thanks".

This would then stay that way until the user refreshes the page.

Any ideas or resources for such a replacement method with php/js I'd really appreciate it.

This post has been edited by AUAN: 26 February 2010 - 07:20 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Contact form completion

#2 Guest_Guest*


Reputation:

Re: Contact form completion

Posted 26 February 2010 - 11:32 PM

You're gonna need some AJAX for what you want to do. I would suggest using JQuery as it makes things much simpler and browser compatibility is not really an issue with it. JQuery Documentation
Was This Post Helpful? 0

Page 1 of 1