473,387 Members | 1,789 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.

To check duplication of values in textbox placed inside datagrid

Hi,I am New To This .
I have to check the duplications of values entered in textbox which is placed inside the datagrid.And the Number of textbox is not constant it is dynamically added can any one solve this
Jan 2 '08 #1
5 2364
gits
5,390 Expert Mod 4TB
hi ...

please explain it in more detail. what datagrid ... no duplicate values in rows or cols? ... show the code you already have so that we have an example to work with ...

kind regards
Jan 2 '08 #2
Hi

I am having textboxes placed inside the DataGrid which is dynamically added.

I want check duplication of values entered in the textbox using javascript.(it can be either in onchange event or onsubmit event

can anyone guide me
Jan 3 '08 #3
hi ...

please explain it in more detail. what datagrid ... no duplicate values in rows or cols? ... show the code you already have so that we have an example to work with ...

kind regards

Hi.GOOD MORNING.

Thanks for ur response.
Consider my grid having many textbox.And the number of textbox is not always constant.Suppose if am entereing 'thescripts' in one textbox and the same also in another textbox ,it should throw error.

Kindly note the number of textbox in the grid is not constant.
I can do this in server side ,since i want to do this in Jvascript kindy help me.
Jan 3 '08 #4
gits
5,390 Expert Mod 4TB
hi ...

let me give you an example:

[HTML]<html>
<head>
<script type="text/javascript">
// list of already used values
var lookup = {};

function chk_input(node) {
var val = node.value;

if (typeof lookup[val] != 'undefined') {
alert(
'you have used the value ' + val
+ ' already\nin field with id ' + lookup[val]
);
node.select();
} else {
lookup[val] = node.id;
}
}
</script>
</head>
<body>
<input type="text" id="my_val0" onchange="chk_input(this);"/>
<input type="text" id="my_val1" onchange="chk_input(this);"/>
<input type="text" id="my_val2" onchange="chk_input(this);"/>
<input type="text" id="my_val3" onchange="chk_input(this);"/>
<input type="text" id="my_val4" onchange="chk_input(this);"/>
<input type="text" id="my_val5" onchange="chk_input(this);"/>
</body>
</html>
[/HTML]
whenever you change a textbox-value it will be checked against a list of values that were already used and gives you an alert in case we find the value in the list already ...

kind regards
Jan 3 '08 #5
gits
5,390 Expert Mod 4TB
threads merged ... don't double post your questions!

regards
MOD
Jan 3 '08 #6

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

Similar topics

1
by: Derek | last post by:
Another DGrid question... I can not access the values of a cell in a datagrid unless I make them visible. I do not want these fields displayed. I only want to use the values to run a stored...
1
by: Maziar Aflatoun | last post by:
Hi, I have a datagrid which binds to a datareader dgXXXXX.DataSource = rdr; dgXXXXX.DataBind(); On dgXXXXX_EditCommand I can read the value of the selected row( e.Item.ItemIndex) which...
3
by: Kevin Pedersen | last post by:
Hello, I am using an editable datagrid. After I save the changes the datagrid shows the old values. I've read the posts about the Page_Load and not binding the datagrid each time. The SQL that...
1
by: Irishmaninusa | last post by:
Hello Everyone, I have a datagrid and have used a text box as way to allow a user to edit items in the grid. My question for you is how is it possible to write code for the text change event of...
1
by: Simon | last post by:
Hi I have a datagrid with a TemplateColumn where I have put inside a TextBox without databinding with the data source. The TextBox is used to type a number for each row of the datagrid. I have...
0
by: velu | last post by:
Problem in storing values from Executescaler() (inside a data grid.) Situation: I have placed a panel inside a datagrid, which populate a table from a database. Now, I run a query to compare...
2
by: Kiran Kumar Pinjala | last post by:
Hi, May be this is silly, or I just need a second pair eyes to look at this. I am trying to get values that I have edited in a datagrid and update the values with those values. Here is the code...
4
by: Newbee | last post by:
I'm using a table (dynamically generated at runtime) for formatting wherein I have text in the first column, and textboxes in the second column. For example, (1,1) might have the string "Last Name"...
1
by: Joe Blauth | last post by:
Hi all, I was running into a problem with a gridview under ASP.net. What I am trying to do is binding the DataSource dynamically in a way that enables me to edit the rows in the Gridview. This...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.