Jump to content
ryan

PW 3.0.140 & FormBuilder v40 (video)

Recommended Posts

Really nice additions to form builder, as an happy customer of Pro Fields I'm going to purchase Form Builder in the next future for a project I'm working on. 

 High five to your new cat!

Thanks Ryan, you are a great person.

  • Like 6

Share this post


Link to post
Share on other sites

The new FormBuilder features look very nice, thanks!

Lots of questions spring to mind...

1. When using Form A within a Form B, is it possible to override any of the field settings of Form A in the context of Form B? Say, if I was using Form A inside several other forms but I needed one of the fields to be required only within Form B.

2. Is it possible to have show-if and required-if dependencies on fields within Form A that depend on the values of fields within Form B?

3. In a paginated form, are the form values submitted to the server each time Next / Back is clicked? So is each page validated independently and the user cannot move forward until the current page validates, or is all the validation done on the final submit?

4. If each page is submitted/validated independently, can a site admin see partial form submissions in Entries that are abandoned before the final submit button is clicked?

5. Or if the form is only submitted/validated after all pages are completed, how are field errors displayed if they occur on multiple different pages in the form?

6. Is it planned to have an overview navigation of the pagination using the page headings, so a user can jump directly to any previous page in form and can see how far they have progressed through the total form?

7. Do the different pages "know" about the values entered into other pages in the form, so show-if and required-if can depend on values in other pages?

Probably I just need to wait until the new version is released. 🙂

  • Like 9
  • Thanks 1

Share this post


Link to post
Share on other sites

It was really nice to see you in a video explaining things.  The additional capabilities to Form Builder are remarkable.

  • Like 6

Share this post


Link to post
Share on other sites

Hey Ryan! Great stuff again 🙂

I wasn't quite sure where to post this, so asking here first: we're using Composer to set up ProcessWire, but for some reason the dev branch hasn't been updating for a while – any idea what's going on? If you take a look at https://packagist.org/packages/processwire/processwire#dev-dev you can see that the latest timestamp is 2019-08-16 18:11 UTC.

  • Like 1

Share this post


Link to post
Share on other sites

Excellent new features for FormBuilder, Ryan!! Great work! Keep doing videos, they are very informative! Thanks!

  • Like 2

Share this post


Link to post
Share on other sites

Can't wait to get my hands dirty with the upcoming FormBuilder v40.

But there is one thing I'm asking myself now:

How about saving those re-used forms into pages?
Will there be still the need for all kinds of fields for templates?

Share this post


Link to post
Share on other sites

@ryan There seem to be issues with the new toggle field-type.

I just upgraded to the latest PW dev, and installed toggle and placed in basic-page tpl.

The setup is like this:

toggle.thumb.PNG.3a4fed5051858157d2e683e4dc823e17.PNG

On pages with No or Undecided the output of $page->toggle is what I would expect.

However, on the page where I selected Yes:

  • I get only an empty string with Tracy in the frontend.
  • In the backend, when I select Yes and save the page, nothing is selected after page-reload.

(there is neither Yes, No or Undecided with blue background)

Share this post


Link to post
Share on other sites

I can confirm. It looks like processInput is not executed if Yes is checked.

Share this post


Link to post
Share on other sites

@dragan @matjazp I setup a new toggle field exactly as shown in the screenshot, but can't duplicate the issue. Maybe it's something browser specific or maybe it's getting interference from some other module? Do you see any JS errors? Any other factors you can think of?

Share this post


Link to post
Share on other sites

No JS errors. Google Chrome, Windows.

Also: When I previously selected No, then re-edit the page and select Yes, it sticks with No.

It's the same with Firefox and IE11, btw.

$config->debug = true;
$config->advanced = true;
Apache/2.4.39 (Win64) OpenSSL/1.0.2s PHP/7.2.11

Nothing supicious in Tracy.

Share this post


Link to post
Share on other sites

OK I found the culprit: I disabled AdminOnSteroids and now toggle fields behave as they should. 

Share this post


Link to post
Share on other sites
Quote

1. When using Form A within a Form B, is it possible to override any of the field settings of Form A in the context of Form B? Say, if I was using Form A inside several other forms but I needed one of the fields to be required only within Form B.

@Robin S Not yet interactively, though it is possible with hooks. Though I do plan to make it part of the "Form" field settings once the field gets more mature.

Quote

2. Is it possible to have show-if and required-if dependencies on fields within Form A that depend on the values of fields within Form B?

Yes. Existing dependencies in forms you integrate will continue to work, and you can also make fields in the main form be dependent upon fields within an integrated form. The field name for fields in an integrated form is "formName_fieldName" rather than just "fieldName". That's how you can integrate multiple copies of the same form, and still end up with unique field names. So if using dependencies, then you just refer to the "formName_fieldName" in your dependency. For existing dependencies in an integrated form, FormBuilder takes care of converting those for you, so that the dependency works regardless of where else the form is used. 

Quote

3. In a paginated form, are the form values submitted to the server each time Next / Back is clicked? So is each page validated independently and the user cannot move forward until the current page validates, or is all the validation done on the final submit?

Each page is validated independently. It creates a partial entry on the server side (in the DB) and saves it on submit of every pagination. If there are errors on the pagination you submit, it will stay on that pagination until you fix them. 

Quote

4. If each page is submitted/validated independently, can a site admin see partial form submissions in Entries that are abandoned before the final submit button is clicked?

Yes. Partial entries also have their own URL (unique query string) that can be bookmarked or returned to if someone doesn't want to complete it all in one setting or their session expires, etc.

Quote

6. Is it planned to have an overview navigation of the pagination using the page headings, so a user can jump directly to any previous page in form and can see how far they have progressed through the total form?

Yes, but probably not in the first version. Though this is part of the reason why it's setup so that partial entries have their own URL. The page number can be specified in the query string.

Quote

7. Do the different pages "know" about the values entered into other pages in the form, so show-if and required-if can depend on values in other pages?

Any pagination has access to the entire entry server side (should you want to examine anything with hooks), but the front-end/client side only knows about the current pagination. So dependencies across paginations won't work at present. If there's interest in the feature, the plan was to support it by rendering the non-present Inputfields referred to on any pagination's showIf/requiredIf values within the current pagination, but behind a hidden element. In that manner, they are technically present for the pagination's processing and front-end JS, even if not visibly present. 

 

  • Like 1

Share this post


Link to post
Share on other sites

@teppo I'm not sure why that is. Maybe it needs me to add a version tag to it to jog things loose? Anything else you can think of I should test or try from here?

 

Share this post


Link to post
Share on other sites
Quote

How about saving those re-used forms into pages?
Will there be still the need for all kinds of fields for templates?

@wbmnfktr I haven't worked out all the details of this part yet. But fields in an integrated form are still present when it comes to what actions can do with them. They are just renamed to have the field name that represents the "form" field as a prefix for each field in the integrated form. So anything that maps the fields in a form to something else (like a page or spreadsheet) will likely continue to work the same way that it currently does, but would have the integrated forms "opened" (for lack of a better term) so that their fields can be mapped like the others. 

  • Like 1

Share this post


Link to post
Share on other sites
Quote

OK I found the culprit: I disabled AdminOnSteroids and now toggle fields behave as they should. 

Glad you found it. Any particular feature in that module that you found is interfering with the toggle field? Maybe it's something I can test with and work around.

Share this post


Link to post
Share on other sites

@ryan No, not yet. I have only enabled a few functions. What I found strange though (perhaps just coincidence):

The bottom left link "disable AoS" also stopped working as it should, i.e. I had to save module settings twice, before it was disabled.

That link to disable the module has a query string parameter toggle, which is set to 1. And afaik the first toogle field-value (e.g. Yes) also has value 1. That's maybe one toggle too many :-)

  • Like 1

Share this post


Link to post
Share on other sites

@dragan Thanks for testing it out. I don't think it's the query string, as the Toggle field doesn't work with query strings or GET var input. I'm guessing more likely is that AoS is applying some kind of customizations or JS events to radio inputs, and these are conflicting with the events that Toggle uses to make radio inputs look like toggle buttons. Why it's only affecting the "Yes" state though is strange, as I'd expect it to affect all the state, but maybe it has something to do with Yes being the first in the list of inputs, or something along those lines.

Share this post


Link to post
Share on other sites
2 hours ago, ryan said:

@teppo I'm not sure why that is. Maybe it needs me to add a version tag to it to jog things loose? Anything else you can think of I should test or try from here?

One idea would be visiting the Packagist GUI and using the "update" feature from there, and apparently there have been cases where simply logging in can help.

I'd also make sure that the webhooks are still in place and functioning properly (I guess this depends on how you've set things up between Packagist and GitHub) 🙂

Share this post


Link to post
Share on other sites
9 hours ago, ryan said:
Quote

4. If each page is submitted/validated independently, can a site admin see partial form submissions in Entries that are abandoned before the final submit button is clicked?

Yes. Partial entries also have their own URL (unique query string) that can be bookmarked or returned to if someone doesn't want to complete it all in one setting or their session expires, etc.

@ryan Will the user be notified of this possibility? I mean, it is great that using the URL the entire process can be completed later on, but if it is not evident then probably no one will use it, being unaware of this possibility.

Share this post


Link to post
Share on other sites
15 hours ago, matjazp said:

@ryan @dragan I can confirm the problem is in AOS. It's an easy fix for @tpr

Thanks both, it's been fixed in v2.0.20. Sorry for the inconvenience.

  • Like 4

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...