Jquery help

<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
<button id="pay">Paypal</button><button id="fren">Frenchise</button>

<form method="POST" action="done" id="pay1" style="display: none;" >
Enter Paypal ID<input name="pay" type="text" />
</form>



<form method="POST" action="done" id="fren1" style="display: none;">
Frenchise Name<input name="fren" type="text" />
</form>


<script>
    $("#pay").click(function () {
    $("#pay1").show("slow");
    });
    $("#fren").click(function () {
    $("#fren1").show("slow");
    });
    </script>
    </body>
</html>




i just need one thing more in this code that one we click on other button the form first form automatic hide and only that form show on which button we click:confused:

I believe this is what you’re looking for:

<script> 
    $("#pay").click(function () { 
        $("#pay1:hidden").show("slow"); 
        $('#fren1:visible').hide();
    }); 
    $("#fren").click(function () { 
        $("#fren1:hidden").show("slow");
        $('#pay1:visible').hide();
    }); 
</script> 

It will only run the show function if the selected div is not visible(hidden).
It will only run the hide function if the other form is visible.

tHanksss