SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast jejcorbett's Avatar
    Join Date
    Apr 2010
    Location
    Brisbane, Australia
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Removing form fields after submit

    Hi there

    http://www.jasoncorbett.com.au/contact.php

    How can I make my form disappear once the form has been completed and the success message pops up.

    Thanks!

    Jase

  2. #2
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Give the form an ID. Make a script that removes the node of the ID or something like that when the form is submitted?
    http://www.w3schools.com/dom/dom_nodes_remove.asp

    x = document.getElementById('formID');
    x.parentNode.removeChild(x);

    Haven't tested it, but maybe this thing works out.

  3. #3
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jejcorbett View Post
    Hi there

    http://www.jasoncorbett.com.au/contact.php

    How can I make my form disappear once the form has been completed and the success message pops up.
    The success message appears with script disabled, so the decision is being made server side. Why not use the same condition to decide whether to render the form?
    Tab-indentation is a crime against humanity.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •