Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-17-2013, 11:46 AM   PM User | #1
samhor
New Coder

 
Join Date: Mar 2012
Location: USA
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
samhor is an unknown quantity at this point
Question Want a thank you message to appear after the form has been submitted? How?

Hello All,

I have created a form but i am unsure on how to add an a message to appear under the form just to say thank you under the form.

Last edited by samhor; 01-18-2013 at 01:53 AM..
samhor is offline   Reply With Quote
Old 01-17-2013, 12:45 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,033
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by samhor View Post
Hello All,

I have created a form but i am unsure on how to add an a message to appear under the form just to say thank you under the form.
When a form is submitted the page is refreshed. You will need to use server-side coding if you want to display a message after the form submits.


There are two i's in Hendry, aren't there? - Commentator Radio 5 Live
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is online now   Reply With Quote
Old 01-17-2013, 12:47 PM   PM User | #3
samhor
New Coder

 
Join Date: Mar 2012
Location: USA
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
samhor is an unknown quantity at this point
Thumbs up

Quote:
Originally Posted by Philip M View Post
When a form is submitted the page is refreshed. You will need to use server-side coding if you want to display a message after the form submits.


There are two i's in Hendry, aren't there? - Commentator Radio 5 Live
Thanks.. Just want to keep it simple at the moment.. Maybe in the future
samhor is offline   Reply With Quote
Old 01-25-2013, 08:20 PM   PM User | #4
jalarie
Regular Coder

 
Join Date: Jun 2002
Location: Flint, Michigan, USA
Posts: 593
Thanks: 1
Thanked 19 Times in 19 Posts
jalarie is an unknown quantity at this point
Code:
<script type="text/javascript">
function check() {
  document.forms[0].OK.focus();
  document.forms[0].OK.blur();
  return true;
}
</script>

<form ... onsubmit="return check();">
  ...
  <input type="text" id="OK" onblur="location.href='Submitted.htm';" />
</form>
__________________
Visit my site at http://spruce.flint.umich.edu/~jalarie/.
jalarie is offline   Reply With Quote
Old 01-25-2013, 09:13 PM   PM User | #5
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,447
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by samhor View Post
Hello All,

I have created a form but i am unsure on how to add an a message to appear under the form just to say thank you under the form.
The form will not be on the page after it has been submitted unless you include it in the page that you are submitting it to as well - which is rather pointless unless your server side script needs to display errors.

To display a thankyou message after the form is submitted simply include that in the HTML of the page that displays after the form is submitted.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is online now   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:29 PM.


Advertisement
Log in to turn off these ads.