SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to replace html with other html with javascript

    Hey, I am trying to figure out how to replace something with javascript, instead of just add something underneath what I already have. To explain this better, I have my site set up: http://www.glassiator.com/ec/index.php

    So, when you enter your email, it checks if it is valid, and then it sends the email, but underneath the text input box, it displays the text "thank you for your interest... bla bla bla"

    I would like to know if it is possible to instead of add that text at the bottom, to simply replace the the form that is above it.

    Here is the javascript code to insert it.
    Code JavaScript:
    getResponse: function(transport) {
    	$('working').remove();
    	var newData = transport.responseText;
    	this.form.insert({after:newData}).reset();
    }

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    yes it's possible, but it will require someone who works with the Prototype library to properly advise.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •