473,396 Members | 2,154 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.

compare values in multiple text boxes

I've a page where I'm calling record from Database. Each record has an
ID and a text box displayed on the page. When the user fills in the
values of a text box, depending on the values of the text box i've to
do some further work. For eg. I've to add two records if the textbox
value of 2 records is same.

I'll try to create an example here
<-----this is from the DB-------> <-----this is form field--->
ID Task Hrs text box
1 adsfsd 1 a <---- user fills this
2 asdf 1.5 b <---- user fills this
3 eyst 2 a <---- user fills this
4 dghjfghj 2 c <---- user fills this
5 xdfb 1 b <---- user fills this
6 tyety 1.5 c <---- user fills this
________
| Submit |
--------------

So the user has to add hrs of those boxes for which have same values
entered by user. such as adding hrs of record 1 and 3 since both have
"a" entered by the user, adding record 2 and 5, as both have "b"
entered by the user and so on and so forth.

I'm using ASP and Javascript.

Apr 5 '06 #1
2 7951

nidsonline wrote:
I've a page where I'm calling record from Database. Each record has an
ID and a text box displayed on the page. When the user fills in the
values of a text box, depending on the values of the text box i've to
do some further work. For eg. I've to add two records if the textbox
value of 2 records is same.

I'll try to create an example here
<-----this is from the DB-------> <-----this is form field--->
ID Task Hrs text box
1 adsfsd 1 a <---- user fills this
2 asdf 1.5 b <---- user fills this
3 eyst 2 a <---- user fills this
4 dghjfghj 2 c <---- user fills this
5 xdfb 1 b <---- user fills this
6 tyety 1.5 c <---- user fills this
________
| Submit |
--------------

So the user has to add hrs of those boxes for which have same values
entered by user. such as adding hrs of record 1 and 3 since both have
"a" entered by the user, adding record 2 and 5, as both have "b"
entered by the user and so on and so forth.

It seems you need to search a set of values for matches, ensuring that
you don't make the same comparison more than once. I assume that more
than two elements are allowed to be the same value.

Where 'v' is the array of elements and 'len' is the length of 'v',

for( var i=0; i<len; i++ )
for( var j=i+1; j<len; j++ )
if( v[i] == v[j] )
{/* your action */}

--
S.C.

Apr 5 '06 #2
Thanks. I'll try and let you know.

Nidhi

Apr 6 '06 #3

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

Similar topics

0
by: James | last post by:
Hi everyone, I wanna put serveral multiple text boxes on page by logic:iterate in struts, and then get values of these multiple text boxes. But that makes me headache, Could anyone give me a hand?
12
by: Forti2ude | last post by:
Hello, I have a simple form... <form> <select name="foo" multiple> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> </select>
7
by: Gertjan van Heijst | last post by:
Hi, I really hope someone can help me because I've already spend 2 days on this problem and I'm not getting anywhere. I think the problem is that I don't really understand how text boxes store...
1
by: ChadDiesel | last post by:
I'm new to access and need some help. I have a form with a shipment destination at the top. I then have a subform that I enter boxes for that shipment. I have several shipments going at a...
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:
2
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
1
by: RP | last post by:
In my Form, I have 20 or 30 Text Boxes and Combo Boxes. I am using a tabbed interface. When the Form's Close button is clicked, I want to check whether user attempted an entry in any of the Text...
10
by: Eugenio | last post by:
Hi there, I'm returning to this forum for the second time and I would like to say thanks for the great help provided. I've encountered a new problem now and hope that you will be able to help me...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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:
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,...
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.