473,503 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datalist referencing a textbox with javascript

Hi All,

I have a datalist that repeats a list of products and has a textbox called
txtQty which you can change. I would like to put a plus and minus image next
to this textbox that when you click it increments the relevant textbox
accordingly. The problem is obviously that the control txtQty gets named by
the datalist control as it renders it. How can I make sure that clicking the
plus/minus image changes the correct txtQty box.

Thanks in advance

Neil
Oct 25 '07 #1
1 1378
I would play with the event OnItemDataBound and the ClientID of the current
button:

http://msdn2.microsoft.com/en-us/lib...databound.aspx

Good luck
Braulio
/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------


"Neil Steventon" wrote:
Hi All,

I have a datalist that repeats a list of products and has a textbox called
txtQty which you can change. I would like to put a plus and minus image next
to this textbox that when you click it increments the relevant textbox
accordingly. The problem is obviously that the control txtQty gets named by
the datalist control as it renders it. How can I make sure that clicking the
plus/minus image changes the correct txtQty box.

Thanks in advance

Neil
Oct 25 '07 #2

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

Similar topics

1
2380
by: Hrvoje Vrbanc | last post by:
Hello all, I have a DataList control displaying data from the database (some products). There are also TexBox controls and ImageButton controls in the two columns of the DataGrid. I would like...
8
653
by: MattB | last post by:
I think I'm close to making this work, but so far it does not. I have a datalist (id = "dlVFields") on a web form that has an item template with a textbox in it. The textbox id = "txtVerify"....
0
1704
by: Renato Neves | last post by:
My problem is simple, i have a datalist control with some controls inside of EditTemplate (the problem is the same in the DataGrid). I want to have access to this controls, using javascript, but i...
10
2819
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...
0
905
by: Patrick.O.Ige | last post by:
I have a href link in a Datalist <a href="addtocart.aspx" onmouseover="void validateNumericField(document.Form1.txtphone);" onkeyup="jump();" > I'm trying to validate a TextBox with Id...
4
2776
by: Jerry Camel | last post by:
Once the datalist is in edit mode and the text boxes and all happily appear, how can I force the textbox to be the control with focus, so the user can start editing without having to click the...
3
10278
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...
1
1953
by: WB | last post by:
Hi, I would like to do something like this page: http://www.stocklayouts.com/Products/Postcard/Postcard-Template-Design-Library.aspx?kwid=38 Notice when you mouse-over any of the icons under...
3
2794
by: Crazy Cat | last post by:
Hi all, I am developing an asp.net 2.0 application in Visual Studio 2005. On my page I have a simple datalist that is bound programmatically to a collection of simple objects. On this page I...
0
7202
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
7086
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
7330
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...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.