www.webdeveloper.com
Results 1 to 2 of 2

Thread: Remove content and replace with text

  1. #1
    Join Date
    Aug 2012
    Location
    Programming
    Posts
    21

    Question Remove content and replace with text

    Hiya,

    I have a form and I would like the form to be cleared and show a "Thank you!" sign.
    Code:
    <form action="Submitformcomplete.html" method="POST">
    <h3>Signup for our Newsletter</h3>
    <label>Email: </label>
    <input type="text" name="$wgusername">
    <input type="submit" name="$wgSignup" value="Sign up!">
    </form>
    What javascript do I need to add?

    Cap123

  2. #2
    Join Date
    Jul 2011
    Posts
    131
    Add some div that wrapped your form and add an id attribute to form, let's say "signup-form". Then you can do it with jQuery:
    Code:
    $("<div>Thank you!</div>").insertAfter($("#signup-form"));
    $("#signup-form").remove();
    or with javascript:
    Code:
    var form = document.getElementById("signup-form");
    form.parentNode.innerHTML = "<div>Thank you!</div>";

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles