-5

I'm trying to create a newsletter signup where there is a button that says sign up and when a user clicks on it the button disappears and a textbox shows up and then when the user has clicked the submit button and it goes through the validation checks it then disappears and gets replaced with a thank you.

Can someone show me how to do it or point me in the right direction. I have searched and I'm not finding anything.

2 Answers2

0

Sounds like you want a "popup" to appear. Obviously popups are bad as those are blocked so you can use DIV.

Have a look at this

How to display div after click the button in Javascript?

Show/hide div on button click

How can I hide/show a div when a button is clicked?

Hope this puts you on the right road.

Community
  • 1
  • 1
-1

Here, I did it for you: http://jsfiddle.net/3SFDy/
Make sure to read up on jQuery: http://api.jquery.com/

jQuery:

$('span').hide();
$('form').hide();
$("#subscribe").click(function(){
    $("#subscribe").hide();
    $('form').show();
});
$('form').submit(function(){
    $('form').hide();
    $('span').show(); 
});
Rahul Desai
  • 15,242
  • 19
  • 83
  • 138