check box in datalist

Discussion in 'ASP .Net' started by =?Utf-8?B?bWFoc2E=?=, May 3, 2004.

  1. hi I want to use a check box in datalist when user checked the check box price will be shown in the textbox in the same row in datalist do you have any idea
    <input onclick="test()" style='border:0px;' type='checkbox' name='"add_" +<%# DataBinder.Eval(Container.DataItem, "PartNo") %>' id='<%# DataBinder.Eval(Container.DataItem, "PartNo") %>'
    I use this but when i check the check box it say error on pagedo you know any sampl
     
    =?Utf-8?B?bWFoc2E=?=, May 3, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?bWFoc2E=?=

    Rick Spiewak Guest

    You'll need to add an event handler to the check box. Do this in the page
    load postback event if the edititem index <> -1. Use a template so you'll
    have an ID to use to find the control. In the event handler, similarly, find
    the textbox and put the value into it.

    "mahsa" <> wrote in message
    news:...
    > hi I want to use a check box in datalist when user checked the check box

    price will be shown in the textbox in the same row in datalist do you have
    any idea?
    > <input onclick="test()" style='border:0px;' type='checkbox'

    name='"add_" +<%# DataBinder.Eval(Container.DataItem, "PartNo") %>' id='<%#
    DataBinder.Eval(Container.DataItem, "PartNo") %>'>
    > I use this but when i check the check box it say error on pagedo you know

    any sample
    >
    >
     
    Rick Spiewak, May 4, 2004
    #2
    1. Advertising

  3. hi
    I try to add event handler to page but the checkbox will add in datalist so it dosent know check box at this time
     
    =?Utf-8?B?bWFoc2E=?=, May 4, 2004
    #3
  4. =?Utf-8?B?bWFoc2E=?=

    Rick Spiewak Guest

    Then add the event handler when you add the checkbox - but be aware that
    dynamically added controls have to be re-created on every postback! You
    should define the checkbox in the edit item template.

    "mahsa" <> wrote in message
    news:...
    > hi,
    > I try to add event handler to page but the checkbox will add in datalist

    so it dosent know check box at this time
     
    Rick Spiewak, May 4, 2004
    #4
  5. my problem dosent solve yet I want to have
    claa void in onclick of my check bov if I us
    function setProps ( )

    msg.innerText = "llll";

    in <datalist>
    <ItemTemplate><input type="checkbox" id="cbItem" runat="server" onclick="test()

    value='<%#DataBinder.Eval(Container.DataItem, "PartNo")%>' NAME="cbItem"><%#DataBinder.Eval(Container.DataItem, "PartNo")%><td class='item_content' width='83'><input value=4 maxLength='4' size='4' name='"qty_"+<%#DataBinder.Eval(Container.DataItem, "PartNo")%>'>Cartons</td><td class='item_content' width='76' vAlign='center' align='right'><p style='width:50px;'><span id='"subtotal_"+<%#DataBinder.Eval(Container.DataItem, "PartNo")%>'></span></td></ItemTemplate
    it works but when i change it to c

    <script language="c#"
    void test ( )
    msg.innerText = "llll"

    </script
    it say error oon pag
    I want if user click on the check box immidiatly textbox of price and quantity will fill
     
    =?Utf-8?B?bWFoc2E=?=, May 5, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mit
    Replies:
    1
    Views:
    823
    Ramu Pulipati
    Jan 25, 2006
  2. Nevyn Twyll
    Replies:
    8
    Views:
    1,916
  3. Gnarlodious
    Replies:
    4
    Views:
    17,641
    elizas
    May 5, 2010
  4. mahsa

    please helpppppppp check box and datalist

    mahsa, May 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    311
    mahsa
    May 5, 2004
  5. Jim

    Check box and text box disable

    Jim, Jun 3, 2004, in forum: Javascript
    Replies:
    3
    Views:
    126
    Randy Webb
    Jun 4, 2004
Loading...

Share This Page