Page 1 of 1
Dynamically adding fields to a form
Posted: Mon Jan 13, 2014 9:35 am
by nicoloose
Happy New Year ALL,
I am trying to create an invoice detail type scenario where I can add multiple lines of the same information to a form. The detail can have one to 5 detail lines. Can anyone suggest how I can do this? Ideally I would like to start off with one detail line where I would choose a product from a drop down list, enter the information such as cost, qty etc and then click "Enter another Line". Another detail line would be presented to the user and so on?
Many thanks
Nic
Re: Dynamically adding fields to a form
Posted: Mon Jan 13, 2014 2:41 pm
by vedus
the most simple method i know is this
check the dictionary with keyword "add"
Re: Dynamically adding fields to a form
Posted: Mon Jan 13, 2014 2:51 pm
by Klaus
Hi vedus,
vedus wrote:check the dictionary with keyword "add"
which you did not obviously
-----------------------------------------------------------------------------------------------
Add:
Adds a number to a container and places the resulting value in the container.
...
----------------------------------------------------------------------------------------------
Best
Klaus
Re: Dynamically adding fields to a form
Posted: Mon Jan 13, 2014 3:41 pm
by vedus
Klaus wrote:Hi vedus,
vedus wrote:check the dictionary with keyword "add"
which you did not obviously
-----------------------------------------------------------------------------------------------
Add:
Adds a number to a container and places the resulting value in the container.
...
----------------------------------------------------------------------------------------------
Best
Klaus
hehe hi klaus

well some times i forget some lines

btw the question from the friend above is add field in the thread but the post is for lines

so here is what i use for field creation with code
Code: Select all
on mouseUp
// Make a dialog
ask "please enter the name of field" with "ok" and "cancel"
//get the result
if it is not empty then
//put the result into array
put it into t1
//create the field
create field "fld1"
//put the field in the card
set the rectangle of fld "fld1" to 80,100,200,200
//set the name into the name you get from the ask dialog
set the name of fld "fld1" to t1
//if is cancel exit
else
exit mouseUp
end if
end mouseUp