Click here to Skip to main content
13,006,195 members (78,763 online)
Rate this:
Please Sign up or sign in to vote.
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 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 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");

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

1 solution

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

Solution 1

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170628.1 | Last Updated 26 Oct 2012
Copyright © CodeProject, 1999-2017
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