Use form field value as default for column when adding table row

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

fronsky
Ebase User
Posts: 86
Joined: Thu Mar 08, 2018 2:52 pm

Use form field value as default for column when adding table row

#1

Postby fronsky » Tue Apr 03, 2018 7:32 pm

How can I use the current value of a form field as a default for a column when adding a row in a table? (Like in the cd exercise).

It's unclear to me how to use the 'Default value' in the properties tab for that.
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

Re: Use form field value as default for column when adding table row

#2

Postby Segi » Tue Apr 03, 2018 10:04 pm

I think that I understand what you're asking but I want to be sure.

So you have a field called SOMEFIELD

When you a row is added to the table, you want to put the value of SOMEFIELD into one of the columns of the table ?

If that's right, you cannot use the default value as far as I know. What you can do is add an Add Row event in the table properties that gets called when a new row is added.

In the script that gets called when an add row event is triggered, you'd add something like this:

tables.MYTABLE.SOMECOLUMN.value=fields.SOMEFIELD.value;
Last edited by Segi on Thu Apr 05, 2018 2:58 pm, edited 1 time in total.
0 x

fronsky
Ebase User
Posts: 86
Joined: Thu Mar 08, 2018 2:52 pm

Re: Use form field value as default for column when adding table row

#3

Postby fronsky » Wed Apr 04, 2018 10:27 am

Thank you for your support. This works!
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

Re: Use form field value as default for column when adding table row

#4

Postby Segi » Wed Apr 04, 2018 3:03 pm

You're welcome. Glad to help
0 x


Who is online

Users browsing this forum: No registered users and 15 guests