Hi,

I hope your code needs a minor repair only:
- somehow disappeared the <BODY> & <FORM ..> headings <BODY><form method="post" action="[I]./ThePage.php[/I]"> where ./ThePage.php should be overwritten with correct destination page name;
- the send() function was not extended:

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();
}

- a cosmetic cleaning could be:

var selN = oRow.nextSibling.getElementsByTagName('select')[0];
      selN.selectedIndex=0;

in add(oRow)

- 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.firstChild reffers 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

thnx to God and Sysel..
Finally i have done.. what i want..!!!

Dom is very Complex and Confusing..!!

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.

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.

Debit and Credit are accounting terms and i m making web application just like telly software(popular accounting software)...!!!

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..!!

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 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...!!!

oRow.parentNode.replaceChild(oRow.cloneNode(true),oRow.parentNode.insertRow(oRow.rowIndex+1));

What this code exactly do.. kindly clear my doubt..!! :)

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 ([B]true[/B])
oRow.parentNode.replaceChild(oCloneOfThisRow,oInsertedRow); // change the new but empty row with the row clone

With 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..!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.