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

insertRow_checkbox won't function

11
With the help of a few snipets and reading many tutorials I have developed a form that is filled out and printed by the customer. On the form are three check boxes, each of which transfers an amount to a textbox in the same row. The customer can insert another row which starts the process again. My problem is that the parent-row works fine, but each subsequent row will not tally its check-box to that rows text-box. Please realize that I am brand-new to HTML & JAVASCRIPT so any understandable solution will be appreciated. Instead of just showing a lot of code I've taken out most of what is not needed for this problem and placed it at my site:
http://www.aaronzjukebox.com/R2CDorder1
Mar 8 '07 #1
5 1127
acoder
16,027 Expert Mod 8TB
You've only written onclick code for the three original checkboxes.

When you create the rows and the checkboxes, add an onclick event handler to each checkbox.

Also, you will have to alter your function slightly so that it can deal with any set of checkboxes. Pass the row number.
Mar 8 '07 #2
decren
11
Thank you for your quick response - and I apologize for not asking the right question.

You've only written onclick code for the three original checkboxes.

I realize the above, but I don't understand how to find the names (or id's) of the checkbox's in subsequent rows so that I can write an onClick command to them. Maybe I don't grasp what is obvious and need to look at a few more tutorials (LOL) Anyway I've been plugging at this for too long today (it's 5AM my time) and I'll get a fresh start later.

Also, you will have to alter your function slightly so that it can deal with any set of checkboxes.

I did figure that out...

Pass the row number.
...but don't have a clue what you mean by the above.

Anyway, I do appreciate your assistance.
Mar 9 '07 #3
acoder
16,027 Expert Mod 8TB
...but don't have a clue what you mean by the above.
At first I thought you didn't understand any of my response, then when I looked closer, I realised you'd posted your response within the quotes!

Just add the onclick event when you're creating the checkbox (giving names, ids, values, etc.) See this tutorial.

Re. the row number. You're uniquely identifying the checkboxes by the row number, so just pass the row number as an argument in your function. Then use that to get the id of the checkbox, e.g.
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('checkbox'+rowno);
Mar 9 '07 #4
decren
11
I was once again scanning this site when I realized I never thanked you for the information. That part worked great after your guidance, but alas I had too many other problems with what I was trying to do so I've gone in another direction. Again THANK YOU!
Mar 26 '07 #5
acoder
16,027 Expert Mod 8TB
You're welcome - glad I could be of assistance. Even though it didn't solve your problem, it might help you in the future.
Mar 27 '07 #6

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

Similar topics

5
by: lawrence | last post by:
I've this function, which is the method of a class. I'm posting the constructor of the class down below. For some reason, when I fill out a form and hit submit, I'm not getting any values. Can...
6
by: HH | last post by:
I'm learning to design web applications with php, mysql, and apache from a book. I copied a sample application called guestbook 2000 that came with the CD in the book to my htdocs folder, but...
3
by: Dave C | last post by:
I've written the following code that won't compile, trimmed down to just the pertinent stuff: --- WindowClass.hxx ---------------------------------------------------- #include <set> class...
4
by: Wm | last post by:
I have a script that changes a main/enlarged image when you click on a thumbnail. It works fine in IE, but for some reason it won't do anything in Netscape 7.1. Does anyone know if this is a...
6
by: Joop | last post by:
Hi all, I'm kinda new to JavaScript, but hey... I'm trying anyway! ;-) So, here's my problem : I've created a table in my document, presenting a list of items, one can 'select' by clicking...
28
by: Bill | last post by:
Hello All, I am trying to pass a struct to a function. How would that best be accomplished? Thanks, Bill
6
by: newbie | last post by:
class AbstractBox { public: virtual double area() const = 0; } class BoxA : public AbstractBox { virtual double area() { return 0.1; } } class BoxB : public AbstractBox {
4
by: mwanstall | last post by:
Hi All, I have started tearing my hair out over this problem! I am pulling some data from a table and passing it as variables into a function in Access. One of the variables I'm passing through...
4
by: dolphin | last post by:
Hi All I read a .cpp files,find that static void fun(void){......} int main() { .......... } What does this static function mean?Is it the same as the static
32
by: Greg | last post by:
I know I can use the Microsoft.VisualBasic.Left function to get the left portion of a string, but I would prefer to avoid using any Microsoft.VisualBasic namespace items. What is the equivilant in...
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: 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...
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
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
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...

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.