|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Call Javascript function .. Please help
Thanks a lot for great help...what I want is ..
Let me elaborate the "insert" part of the records By default only one row of these fields are visible pn clicking add line button a row is added This way a user can enter as many rows as possible. I can add as many row as possible (wirh click event and using addLine function and store these records in a database. When I want to modify them I need to show 'n' number of records that are alreadt stored in a database. (n is alaways variable ranfing from 1 to 999 or a value I donot know) In order to display 'n' number of records. For this I had written a query to fetch all reuqired records. Upto this it's OK while display records I need to add row I am calling addLine dunction for this But row is not added in html tabel Code:
<script language=JavaScript>
alert(' Calling addLine');
addLine() ;
alert ("Function over ");
</script>
I can see 'Calling addLine' and 'Function over ' messages bot the row is not getting added Please help My addLine function .... Code:
function addLine() {
var objSource = window.event.srcElement;
var currentTR, currentTD, currentSelect, temp;
alert("calling addline function");
//set row number
inputCount++;
document.frm.containers.value = inputCount;
//here we will delete the line
while ( (objSource = objSource.parentElement) && objSource.tagName !="TBODY");
//add the tr to the table
currentTR = objSource.insertRow();
// currentTR.bgColor = "red";
currentTD = currentTR.insertCell();
currentTD.innerHTML = "<input type='text' size='10' name='containerno"+inputCount+"'>";
// conatinertype"+inputCount+"
currentTD = currentTR.insertCell();
currentTD.innerHTML = "<select name='containersize"+inputCount+"' > <option value='1' >6' </option> <option value='2' class='text-b12'>10'</option> <option value='3' class='text-b12'>20'</option><option value='4' class='text-b12'>40'</option><option value='5' class='text-b12'>40 HC</option>b<option value='6' class='text-b12'>20 HC</option></select>";
currentTD = currentTR.insertCell();
currentTD.innerHTML = "<div align='center'> <select name='containertype"+inputCount+"'> <option value='1'>OT</option> <option value='2'>TR</option> <option value='3'>GP</option> <option value='4'>RF</option> </select>";
currentTD = currentTR.insertCell();
currentTD.innerHTML = "<input type='text' size='10' name='pikupdate"+inputCount+"' value='dd-mm-yyyy' onblurr='chkdate(this)'>";
currentTD = currentTR.insertCell();
currentTD.innerHTML = "<input type='Button' class='Button' onclick='removeLine()' value='Delete this line'>";
}
|
|
#2
|
||||
|
||||
|
Is this in response to an earlier post? If so, please repost in the original thread so there's some context.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Call Javascript function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|