Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #31574
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: AJAX forms |
| Date | 2016-10-14 21:42 +0100 |
| Message-ID | <141020162142022847%timstreater@greenbee.net> (permalink) |
| References | <853ac26d-01db-49dd-9d77-62f49b7fcaae@googlegroups.com> |
In article <853ac26d-01db-49dd-9d77-62f49b7fcaae@googlegroups.com>, <bit-naughty@hotmail.com> wrote: >If I have a form where people write stuff and post it (a forum, say) - when >they click "Post", I want the form to disappear, and a "Message posted" or >whatever text to appear, via AJAX.... - my question is, after the message has >been posted, ie. the server side replies with an "OK" or whatever, how do I >get rid of the form on the page and replace it with the "Message posted" text? If you have a proper form, as in the <form> element, simply submitting it (no AJAX needed) will send the form information to the server. It's up to you to write the script on the server to process that and return a new HTML page to be displayed which will replace the form page. Shouldn't need any javascript for that. -- New Socialism consists essentially in being seen to have your heart in the right place whilst your head is in the clouds and your hand is in someone else's pocket.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
AJAX forms bit-naughty@hotmail.com - 2016-10-14 13:15 -0700
Re: AJAX forms Tim Streater <timstreater@greenbee.net> - 2016-10-14 21:42 +0100
Re: AJAX forms bit-naughty@hotmail.com - 2016-10-19 06:43 -0700
Re: AJAX forms Tim Streater <timstreater@greenbee.net> - 2016-10-19 15:07 +0100
AJAX forms Ram Tobolski <ramtob@gmail.com> - 2016-10-20 10:20 -0700
Re: AJAX forms JJ <jj4public@vfemail.net> - 2016-10-21 20:37 +0700
csiph-web