473,396 Members | 1,942 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,396 software developers and data experts.

How to Compare the Textbox Client id in JavaScript?

Hi to All,

I want to Compare the Two Textbox ClientId not a Value of them, whether clientid is equal i perform something oterwise not.

Expand|Select|Wrap|Line Numbers
  1. for (var i = 2; i <= document.getElementById('ctl00_cphMaster_grdPaymentAmount').rows.length - 1; i++) {
  2. if(document.getElementById('ctl00_chMaster_ctl04_txtPayAmount') == document.getElementById('ctl00_chMaster_ctl0' + i +'_txtPayAmount'))
  3. alert("Some");
  4. }
  5.  
because the i bind the textbox into gridview, so the value of the textbox is entirely different to previous value.

but the if statement match all loop increment.

How can i do this?

Please Help me.

Thanks a lot.
Jul 7 '10 #1
1 2688
acoder
16,027 Expert Mod 8TB
I'm not quite sure if I'm following, but if you want to match the client ID, surely you'd just check if i equals 4?
Jul 8 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mark | last post by:
All, Excuse the re-post but I have found something which works for the UserID but not for the Password (see previous post below). The problem is I don't understand how it works and therefore...
2
by: Matthew Wieder | last post by:
Hi - I'm trying to do client-side validation of the text in a Asp.Net textbox control using javascript. My page has the following: <form id="Form1" method="post" runat="server" onsubmit="return...
3
by: Gary Varga | last post by:
In the file WebUIValidation.js, when a postback that doesn't fail the validation has a javascript error saying summary is undefined in the ValidationSummaryOnSubmit function....
1
by: Robert Storrs | last post by:
I need to set the value of a asp text box in javascript. <asp:TextBox id="txtUserValue" runat="server" >test</asp:TextBox> I have tied: function setValue(valueData) { alert(valueData);
1
by: PJ6 | last post by:
How do I select a subset of text in a textbox using JavaScript? Paul
2
by: alanliang | last post by:
I want to be able to populate an asp textbox with logitude and lattitude values whenever a user selects a point or creates a marker on google maps. Simply, how do I change an asp's textbox value...
2
by: VMI | last post by:
In the Page_Load() of my webForm, I have the following code, and on my HTML button, the onclick button calls writeVal() (the javascript function). When I click on the button, I see the messagebox...
2
by: Xzorius | last post by:
Hi, Simple question: how do i change the background color of a textbox with javascript? BuBbA
8
by: frohlinger | last post by:
Hi, I have a search textbox in my website. I validate the search string with a "white list" of allowed characters: if((/^+$/).test(theSearchWord) == false) { return; }
1
by: gopim | last post by:
count no of values enter into the textbox through javascript that should be dispalyed in one label control.
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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
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
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,...

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.