Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi friends, I have a view which which has few tabs, in one of the tab i have search and a cart, i have a "submit" button in the cart.to add items into cart i have a "add to cart" button in a panel which pop when i click on the item,and when i click "add to cart" it send the selected item into the cart.now i want to disable that button till some items are added into the cart and as soon as items are added to that cart by clicking the "add to cart" i want that button to be enabled.and if the items are deleted from the cart i need to disable the button again. i need to do this on the client side(as all my scripting is on client side). below is the button and the script for disabling the button. The button has disabled but i'm not able to enable it back, when i click the ad to cart.

Add to cart button in the panel
JavaScript
<input class='button' type='button' onclick=\"Add to cart(\'" + hash + "\');\" value='add to cart'/>

I have a function for the add to cart which has the information about the item

submit button is inside a "div" and when we we click add to cart the selected item is sent inside this "div" which has submit and cancel order.
JavaScript
<button id="submit" >Submit</button>

<script type="text/javascript">
    $(document).ready(function () {
       
        $(function () {
                        //Set button disabled
                        $("#submit").attr("disabled", "disabled");
                       });

                       $('#submit').trigger('change');
        });

</script>

now how do i enable the submit button in the
when i click "add to cart" in the panel
Posted
Updated 26-Oct-12 5:22am
v2

1 solution

First send Add cart function we get idea from that code only
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900