473,402 Members | 2,055 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,402 software developers and data experts.

compare text box values

parshupooja
159 100+
Hey all I have two text boxes. I want to show message if text box1 value is not equal to textbox2

I have written this but it does not work


Expand|Select|Wrap|Line Numbers
  1. function ValidatePost()
  2. {
  3.  
  4.      if(document.getElementById("<%=txtsign.ClientID%>").value != document.getElementById("<%=txtId.ClientID%>").value)
  5.       {               
  6.                  alert("-------------------------");
  7.                  document.getElementById("<%=txtsign.ClientID%>").focus();
  8.                  return false;
  9.       }
  10. }
thanks
Jan 24 '08 #1
5 3877
acoder
16,027 Expert Mod 8TB
How is this function called?
Jan 24 '08 #2
parshupooja
159 100+
on change on of textbox1. textbox 2 gets value by itself on page load, so when user enter value in textbox 1 I want trigger validation.

thanks

How is this function called?
Jan 28 '08 #3
acoder
16,027 Expert Mod 8TB
on change on of textbox1. textbox 2 gets value by itself on page load, so when user enter value in textbox 1 I want trigger validation.

thanks
So, is it something like:
[html]<input type="text" name="txtsign" id="somethingOrOther" onchange="ValidatePost()">[/html]

Just a note: please don't top-post. Thanks!
Jan 28 '08 #4
parshupooja
159 100+
yes, i guess thats how it shd be, but it still does not work

So, is it something like:
[html]<input type="text" name="txtsign" id="somethingOrOther" onchange="ValidatePost()">[/html]

Just a note: please don't top-post. Thanks!
Jan 28 '08 #5
acoder
16,027 Expert Mod 8TB
Have you checked that the IDs of the textboxes match with those used in the function? Are there any errors? If not, post your full code (if it's not too much) or a link to a test page.
Jan 29 '08 #6

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

Similar topics

5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
11
by: Russ Green | last post by:
How does this: public TimeSpan Timeout { get { return timeout; } set { timeout = value; if(timeout < licenseTimeout) licenseTimeout = timeout; }
0
by: TN Bella | last post by:
Hi, I am trying to get my compare validator to fire properly...Since I have panels the validator wouldn't work properly, the app would fire right but would insert the data regardless and the...
0
by: Wee Bubba | last post by:
i have completed a Compare() function to help me sort the contents of a ListBox. I wanted to give the user of the class the ability to sort by EITHER ListItem.Text OR ListItem.Value. ALSO sometimes...
5
by: rcolby | last post by:
Evening, Wondering if someone can point me in the right direction, on how I would compare a system.guid with a system.byte. system.guid (pulled from sql server table with a data type of...
7
by: Prabhudhas Peter | last post by:
I have two object instances of a same class... and i assigned values in both object instances (or the values can be taken from databse and assigned to the members of the objects)... Now i want to...
5
by: Jason | last post by:
Is there a mechanism in VB.NET that allows something like: If myVar In ("A","B","C") Then... The way I'm doing it now is: Select Case myVar Case "A","B","C" Or like this:
10
by: Y2K | last post by:
Any suggestions to compare two values, and if either value changes, then both values now become the changed values. Right now I'm doing it with a textbox and onchange event, but would like to get...
6
by: napatel04 | last post by:
Hi everyone, I would like to know if there is a quick query someone can help me write for the following scenario. I think I can do this with VBA but since this is suppose to be a temp. solution,...
6
by: aznimah | last post by:
hi, i'm work on image comparison. i'm using the similarity measurement which i need to: 1) convert the image into the binary form since the algorithm that i've use works with binary data for the...
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
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
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
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...
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.