Use subform field in button on subform

Questions related to using nuBuilder Forte.

Use subform field in button on subform

Postby hf2094 » Fri Jan 04, 2019 5:08 pm

Hello,
I want to use a subform field #Position# (input-text; editable) as URL for a button on the subform:

nubuilder1.png
nubuilder1.png (56.34 KiB) Viewed 75 times


The button is defined as INPUT-BUTTON with Custom code

nuBuilder2.png
nuBuilder2.png (23.93 KiB) Viewed 75 times


Pressing the button results in a webpage "localhost/minadmin/#Position#" ?
Maybe this is already discussed in the forum, but I cant find it.

Thank you for your help.
hf2094
 
Posts: 8
Joined: Thu Jan 08, 2015 3:41 am

Re: Use subform field in button on subform

Postby kev1n » Fri Jan 04, 2019 6:19 pm

Use this Javascript:

Code: Select all
var p = $(this).attr('data-nu-form') + $(this).attr('data-nu-prefix').slice(-3) + 'Position'; window.open($('#'+p).val());
kev1n
 
Posts: 53
Joined: Mon Oct 15, 2018 2:13 am

Re: Use subform field in button on subform

Postby hf2094 » Fri Jan 04, 2019 6:50 pm

@kev1n,
solution works perfectly. Thank you.
yours, Hf2094
hf2094
 
Posts: 8
Joined: Thu Jan 08, 2015 3:41 am

Re: Use subform field in button on subform

Postby admin » Mon Jan 07, 2019 5:01 am

.
admin
Site Admin
 
Posts: 3000
Joined: Mon Jun 15, 2009 9:53 am


Return to General



cron