pass value form child form to parent

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

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

pass value form child form to parent

#1

Postby Steve James » Tue May 16, 2017 1:22 pm

Is it possible to set a field value in a parent form from a form that is being displayed in a dialog?

I have a "parent form". At some point I have an event that opens a child form in a dialog.

I have a beforeClose event and I want to continue action in my parent form based on what occurred in the dialog form.

I've done this in the past with checking the html of the dialog form and it could be done by setting cookie etc

Is there a better way of doing this?

Thanks
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Tue May 16, 2017 2:46 pm

You can use client side Javascript window.parent e.g. when you close the popup dialog:

// Set an input field value directly with jQuery
window.parent.$("fieldId").val("xxx");

// set field value on server and refresh
window.parent.$eb.setFieldValue("fieldname", value, true)
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#3

Postby Steve James » Wed May 17, 2017 7:00 am

Excellent thanks Jon.
0 x


Who is online

Users browsing this forum: No registered users and 146 guests