| | |
Add/Remove rows from Table
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
•
•
Hi,
I hope your code needs a minor repair only:
- somehow disappeared the <BODY> & <FORM ..> headings
<BODY><form method="post" action="./ThePage.php">where ./ThePage.php should be overwritten with correct destination page name;
- the send() function was not extended:- a cosmetic cleaning could be:JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
function send(oForm) { var inpF = oForm.getElementsByTagName('input'); for(i=0;i<inpF.length;i++) { inpF[i].disabled=false; } var inpF = oForm.getElementsByTagName('select'); for(i=0;i<inpF.length;i++) { inpF[i].disabled=false; } oForm.submit(); }in add(oRow)JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
var selN = oRow.nextSibling.getElementsByTagName('select')[0]; selN.selectedIndex=0;
- the<TABLE> ... </TABLE>definitely MUST be unformated in the code -> written as one single row, because, each [formating | invisible] character as spaces, tabs, and end of line can brake the structure of the DOM (Document Object Model) inserting the unwanted #text elements, hence the relative reference of the type:oElement.parentNode.nextSibling.firstChildreffers to the invisible character instead of the next <INPUT> box.
It is highly recommended to use frequently in FireFox the Error console (or whatever it has English name) and the DOM Inspector (available as free FF plugin). Lot of people use the FireBug plugin for direct debugging of the JavaScript code.
The database exploit seems to be well coded I hope it makes no problems.
I must again admit, that the styled document looks much better than the 'technical' skeleton only :-)
Sir i want to disable the textbox also.. if first textbox is filled then second textbox got disabled...vice versa..
I know i have to make changes in emtryStr() but i didnt find the right way..!!!
Help me out
•
•
Join Date: Jun 2009
Posts: 49
Reputation:
Solved Threads: 3
Hi, I had no chance to write long posts, neither to test the script modification, while iPhone does not offer JavaScript IDE of any kind :-)
But I do not fully understand the last request - to disable unused text field. I can understand the motivation but not the goal. Credit and debet are mathematicaly nubers of the same kind hence it could be more correct to use only one text (number) input field and specify by math sign + or - if the amount is to be added or subtracted.
If two field for separated credit/debet input is used it may be checked that only one is filled in and consequently block the continue of any kind, but disable is not the good idea, because it inhibits the possibility of editing. Yes, one can delete the whole line, and add a new one. But it sounds me much more contraproductive.
Please, try to think over the whole process, and draw yourself the diagrams with data flow and realation between the routines and pages.
I can show you some tricks and examples but the analyses and code it is your deal.
But I do not fully understand the last request - to disable unused text field. I can understand the motivation but not the goal. Credit and debet are mathematicaly nubers of the same kind hence it could be more correct to use only one text (number) input field and specify by math sign + or - if the amount is to be added or subtracted.
If two field for separated credit/debet input is used it may be checked that only one is filled in and consequently block the continue of any kind, but disable is not the good idea, because it inhibits the possibility of editing. Yes, one can delete the whole line, and add a new one. But it sounds me much more contraproductive.
Please, try to think over the whole process, and draw yourself the diagrams with data flow and realation between the routines and pages.
I can show you some tricks and examples but the analyses and code it is your deal.
•
•
•
•
Hi, I had no chance to write long posts, neither to test the script modification, while iPhone does not offer JavaScript IDE of any kind :-)
But I do not fully understand the last request - to disable unused text field. I can understand the motivation but not the goal. Credit and debet are mathematicaly nubers of the same kind hence it could be more correct to use only one text (number) input field and specify by math sign + or - if the amount is to be added or subtracted.
If two field for separated credit/debet input is used it may be checked that only one is filled in and consequently block the continue of any kind, but disable is not the good idea, because it inhibits the possibility of editing. Yes, one can delete the whole line, and add a new one. But it sounds me much more contraproductive.
Please, try to think over the whole process, and draw yourself the diagrams with data flow and realation between the routines and pages.
I can show you some tricks and examples but the analyses and code it is your deal.
if debit is filled with values then Credit must be blank and if credit is filled then Debit must be Blank...!!!and the Total of debit and Credit must be equal before Process...!!!
I have done with all the changes...Big Big Thankx to You....!!!
now i can enter one values at a time...!! if one is filled other is disabled..!
but i found javascript DOM very complicated still few things is unclear to me....!!!!
Even if i write
<td></td><td></td>
into this way
<td></td>
<td></td>
this create problem in structure..!!! :O
quiet weird..huh..!!
Last edited by nish123; Jul 9th, 2009 at 8:13 am.
•
•
Join Date: Jun 2009
Posts: 49
Reputation:
Solved Threads: 3
Quit correct - the character <EOL> (End of Line) whatever code it is, ads an additional #text element between the table cells, what means that two consequent cells are not further the neighbors hence this.nextSibling does not reffer to the next cell, but the <EOL> char.
I do not argue against the financial terminology but try to propose some other view: if one input field is accompanied with an e.g. checkbox named "debet", if checked the input field could get red background and if necessary you may collect all white and red input fields separately, either you can add those white and subtract those red backrounded fields and the balance is clear if the result is zero :-) (or red if negative number)
It depends also who is the user of such page. The majority of avarage people better accept the word "pay" vs. "get" :-)
I met with the medicine doctor who need to use the word "diadynamic" current instead of direct or rectified current :-)
I do not argue against the financial terminology but try to propose some other view: if one input field is accompanied with an e.g. checkbox named "debet", if checked the input field could get red background and if necessary you may collect all white and red input fields separately, either you can add those white and subtract those red backrounded fields and the balance is clear if the result is zero :-) (or red if negative number)
It depends also who is the user of such page. The majority of avarage people better accept the word "pay" vs. "get" :-)
I met with the medicine doctor who need to use the word "diadynamic" current instead of direct or rectified current :-)
I will Surely give a try to your proposal...!! but seniors want it in that way only... and now they are suggesting to use Autocomplete or Autosuggest in place of Dropdown..!!!!
means another text box instead of Select...!!!
What this code exactly do.. kindly clear my doubt..!!
means another text box instead of Select...!!!
javascript Syntax (Toggle Plain Text)
oRow.parentNode.replaceChild(oRow.cloneNode(true),oRow.parentNode.insertRow(oRow.rowIndex+1));
What this code exactly do.. kindly clear my doubt..!!
•
•
Join Date: Jun 2009
Posts: 49
Reputation:
Solved Threads: 3
oRow.parentNode.replaceChild(oRow.cloneNode(true),oRow.parentNode.insertRow(oRow.rowIndex+1));
// is in one step the same as:
var oInsertedRow = oRow.parentNode.insertRow(oRow.rowIndex+1); // insert new row after oRow
var oCloneOfThisRow = oRow.cloneNode(true); // create copy of row Element subelements included (true)
oRow.parentNode.replaceChild(oCloneOfThisRow,oInsertedRow); // change the new but empty row with the row cloneWith Autocomplete and Autosuggest you have better to learn Ajax and jQuery a bit. The task is so complex, and it is better to accept debugged portion of code :-)
Thank u Sir...!!!
Finally i got that how this function works...!!!
Yeah i m working Autocomplete...
but first of all i have to remove select dropdown and commands related to it...!!! and in place of slect i have to use Input type...
That means i have to make changes in whole code...!!! becoz now there will be 5 input types..!!
Thanks once again..!!
Finally i got that how this function works...!!!
Yeah i m working Autocomplete...
but first of all i have to remove select dropdown and commands related to it...!!! and in place of slect i have to use Input type...
That means i have to make changes in whole code...!!! becoz now there will be 5 input types..!!

Thanks once again..!!
![]() |
Similar Threads
- DataGridView not reflecting changes to DataTable (C#)
- Add / remove table row. javascript (JavaScript / DHTML / AJAX)
- How to swap two rows of a table in a database using php (PHP)
- How do I add up all values of rows in a table??? (PHP)
- Add remove rows javascript problem.... (JavaScript / DHTML / AJAX)
- Cannot Access Control Panel or Add/Remove Programs!!! (Viruses, Spyware and other Nasties)
- Cant add/remove win components (Windows NT / 2000 / XP)
- Windows 2000 Add/Remove programs don't work... (Windows NT / 2000 / XP)
- Add or Remove Programs... Removed? (Windows NT / 2000 / XP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: validation of Multiple forms in single page
- Next Thread: Enter text into newly created dynamic text box
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate array automatically beta box browser captchaformproblem cart child close codes column css date debugger decimal dependent design disablefirebug dom download element embed engine enter error events ext file firefox form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 ie8 iframe index java javascript javascripthelp2020 jawascriptruntimeerror jquery jsp jump libcurl listbox maps masterpage math media menu microsoft mimic mp4 onmouseoutdivproblem onmouseover onreadystatechange paypal pdf php player position post problem programming prototype redirect regex safari scale scriptlets scroll search security select software sql textarea unicode w3c web website window windowofwords \n





