Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript Ajax C#4.0 jQuery , +
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
<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.
<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 26-Oct-12 4:54am
Edited 26-Oct-12 6:22am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

First send Add cart function we get idea from that code only
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 105
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 26 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100