on 03-04-2010 4:52 PM
Hi,
1. There is a table
2. An add button adds a new line to the table using 'AddInstance'
3. A record is entered in the first line
4. When the add button is clicked it adds a new line and along with it copies the data entered in the first line
My question is how to copy the data from the first line and show it in the new line added. This is required so that user can use most of the common values in the first line.
Thanks,
Nikhil
it's funny.. the first 2 times i created tables, this is exactly what happened to me - i would add a row and it would repeat the previous data... I finally figured out how to do it correctly and forgot how to do it "incorrectly"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the following Java Script in the Click event of the button.
// Get the number of rows in the table
var nrows = xfa.resolveNodes("page.table.DATA[*]").length;
// Add a new instance(row) to the table
page.table.addInstance.instanceManager(1);
xfa.form.recalculate(1);
// Copy the values from the first line to the newly created row
page.table.DATA\[ nrows \].field1.rawValue = page.table.DATA\[ 0 \].field1.rawValue;
..........field2
..........field3
Thanks,
Chandra Indukuri
Hello, You should read a little before scripting, start here:
Note there is one very interesting chapter in the end (the last one;))
Regards, Otto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.