Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Zimlets

Reply
 
LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 02-19-2007, 01:49 AM
Senior Member
 
Join Date: Feb 2007
Posts: 32
jiggy is on a distinguished road
Default Using javascript need to add a row dynamically on click of a button

The scenario is :
When the user clicks on the Add Button a row should get added to the table dynamically.But i need this table to be created at a specific position in the form (as shown in bold below form structure):

I have two functions out of which, in one i am creating my html elements using javascript and in the other i am handling my button events.
The thing is as shown below:

Code:
function createHtml(){


      1. TextField
      2. Add Button1
     3.Dynamic table to be created on the click of Add Button1
      4.Add button2
      5.Dynamic table to be created on the click of Add Button2

}

function handleEvents(e){

        eventHandling code.
}
Now as shown in the above function when the user clicks on Add Button1 i want a row to be get added at the Postion3.And this is to be done everytime the button is clicked at that specific postion only.

Can anybody please help me in achieving this task.
Reply With Quote
  #2 (permalink)  
Old 02-20-2007, 12:49 AM
Zimbra Employee
 
Join Date: Sep 2005
Location: Sunnyvale, CA
Posts: 260
pshah is on a distinguished road
Default

Not sure how much detail you're asking for, so here's the basics...

Assuming you have a reference to the TABLE element, all you would need to do is call "insertRow" on the TABLE and pass in an index value of where in the table you want to insert. Passing in "-1" will append to the end of the table.

To tie everything together, add an onclick handler to each of the buttons. In the handler code, either get a reference to the TABLE if it exists via an ID or create one by calling document.createElement("TABLE").

HTH.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.zimbra.com/forums/zimlets/7080-using-javascript-need-add-row-dynamically-click-button.html
Posted By For Type Date
Zimlets [Archive] - Zimbra - Forums This thread Refback 07-31-2007 10:18 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
need advice on configuring zimbra to work with fax server pheonix1t Administrators 0 07-11-2007 07:46 PM
Zimbra + Samba LDAP, cannot add winxp fajarpri Installation 4 07-08-2007 11:45 AM
Sent, Sent Items, Sent Messages scottp Administrators 4 03-30-2006 09:33 PM
Admin Panel add domain finish button broken tomicles Developers 2 10-08-2005 10:09 PM


freshmeat.net sourceforge.net The best Java IDE



 

Search Engine Optimization by vBSEO 3.1.0