You must Sign In to post a response.
  • Category: ASP.NET

    Product display like flipkart site

    Hello all

    I am preparing shopping cart like flipkart

    i wan to display product like flipkart.
    means when using check boxes for brands.

    i dont know how to write code for checkbox unchecked event. means when i click the checkbox for adidas brand, products for particular brand gets displayed when i click second checkbox, products for both brands gets displayed

    when i uncheck second checkbox, only products for adidas brand remain on the page

    please guide me how to do this

    its urgent

    thanks in advance

    Pranita Parab
  • #763638
    Hai Pranita Parab,
    You need to write the checked/unchecked events using JavaScript or JQuery for the check-boxes.
    As these check-boxes are not fixed, they are coming based on the categories in the database so you need to manage them(if you are also doing in your application).
    For checked/unchecked, you need to get the products and display them similarly they are displayed in the flip kart.
    For the check/unchecked event using JavaScript, you can follow the below link:

    http://stackoverflow.com/questions/31209757/call-jquery-function-for-each-checkbox-on-check-uncheck-all

    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #763644
    Hi,

    You can achieve it using JQuery with simple code, refer below sample code


    $("input:checkbox.country").click(function() {
    if(!$(this).is(":checked"))
    alert('you are unchecked ' + $(this).val());
    else
    alert('you are checked ' + $(this).val());
    });

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

    <input class="brands" type="checkbox" name="brand" value="adidas" /> adidas</br>
    <input class="brands" type="checkbox" name="brand" value="Reebok" /> Reebok <br>


    Try something like above instead of alert message bind your data.

    Hope this will helpful to you...

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #763649
    Sir,

    i will do as per ur suggestions but how to do it in asp.net vb brands are coming from database.


    #763644 Author: naveensanagasetti Online Member Level: Gold Member Rank: 7 Date: 20/Dec/2015 Rating: 2 out of 52 out of 5 Points: 4

    Hi,

    You can achieve it using JQuery with simple code, refer below sample code


    $("input:checkbox.country").click(function() {
    if(!$(this).is(":checked"))
    alert('you are unchecked ' + $(this).val());
    else
    alert('you are checked ' + $(this).val());
    });

    where can i call this function in my code

  • #763651
    Hi,

    Prepare service methods and call that from AJAX call using Jquery, Google it how to call webmethods from AJAX call, that will help you to bind your data from database.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/


Sign In to post your comments