JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 19th, 2004, 03:22 AM
vikaspa vikaspa is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 4 vikaspa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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'>";
      }

Reply With Quote
  #2  
Old July 19th, 2004, 10:13 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Call Javascript function


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT