473,387 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

check box in datalist

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
Nov 18 '05 #1
4 1688
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" <an*******@discussions.microsoft.com> wrote in message
news:78**********************************@microsof t.com...
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

Nov 18 '05 #2
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
Nov 18 '05 #3
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" <an*******@discussions.microsoft.com> wrote in message
news:38**********************************@microsof t.com...
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
Nov 18 '05 #4
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.DataIte m, "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.DataI tem, "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
Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: jenn | last post by:
Hi Anyone knows how to access to a value of a row in a datalist. Something like this in datagrid Dim str = MyDataGrid.Cell(0).tex I would like something like this Dim str =...
0
by: Mark Sandfox | last post by:
What I need to do is simple in any other code, but I am having a problem finding the correct syntax for this function. I have the following: <form Runat="Server">
1
by: mahsa | last post by:
H data I'm binding to the DataList is information about products in my product database. Perhaps passed in the QueryString to this page is a ProductID. I might want to make the item in the DataList...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
4
by: Patrick.O.Ige | last post by:
I have a CheckBoxList in a DataList and i'm trying to get item Selected after doing a postBack. I have set my CheckBoxlist AutoPostBack="True" Any ideas what 'm doing wrong? It seems not to...
6
by: Paul | last post by:
I am trying to use a DataList and the ItemTemplate. I am binding the Datalist to a SQL query that gives me a list of Items with a Parent Category. I want to loop through all the items, but...
2
by: Hans Merkl | last post by:
Hi, I am trying to use a user control as EditItemTemplate in a DataList. It loads fine but I can't figure out how to bind to the data of the DataList. Here is what I have got so far: ...
3
by: Mirek Endys | last post by:
I have DataList as part of DataList item. DataList in DataList. The parent DataList working well including Edit command, that shows Edit template and correctly bind the data into edit template...
0
by: Les Caudle | last post by:
I have a menu system composed of a DataList nested inside a DataList. The outer DataList has it's DataSource (composed of a DataSet with two tables linked by a CategoryPagesRelation Relation) set...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.