Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Enter only New Table Rows

Posted on 2010-11-15
2
Medium Priority
?
305 Views
Last Modified: 2012-05-10
Now I need to make sure that I only enter each combination of select option and checkbox value once into the table and not multiple times. I am thinking I need to use contains().

Any help will save me time.

Thank you
sshivanna
0
Comment
Question by:sshivanna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 2000 total points
ID: 34136662
you need not search each and every value in the table. Just make sure that you give the id value of a  row based on the value of checkbox value, so that before adding the value in table you just need to check if an element based on that value exists or not, ie

if the value of selected checkbox is val1, then make sure that it always goes in row of id value tr_val1, so before creating a new row, just check if an element exists with the same name, by
var element = document.getElementById("tr_"+checkBoxValue);
if (element == null)
{
   alert("element does not exists, so this value is not in the table now");
}

hope this helps
0
 
LVL 2

Author Comment

by:sshivanna
ID: 34136930
That worked perfectly. Thank you.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question