check box in datalist

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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 said:
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?
 
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
 
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 said:
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
 
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
 
Back
Top