Jump to content

ProcessWire Form Builder


ryan

Recommended Posts

I think it was 1999. Then as we reached 2000 and nothing happened, someone did the calculation again and found it really was 2012. But in case we reach 2013 safe, they are already working on refining their parameters to get a new estimation ASAP.

  • Like 3
Link to comment
Share on other sites

Hi Ryan,

When I try to embed a form using the easy embed code I get this where the form should be.

"This page is not intended for direct access."

Perhaps I'm overlooking something?

PS: I just downloaded the form-builder today, and it shows version number 0.1.4. (thought 0.1.5 was the latest?)

PW version 2.2.9

Link to comment
Share on other sites

Version 0.1.6 is actually the latest, but the differences between 0.1.4 and 0.1.6 are just specific feature additions rather than bugfixes or the like. I've updated your access so you can download it from the Form Builder support board (thanks for your order!).

The error you got occurs if a form render is called and there's nothing there. Check to make sure you have at least one field in that form. If that still doesn't do it, let me know what your form builder easy embed code is? Double check that the form name in your embed code matches up exactly with the one in your form settings (must be all lowercase too).

  • Like 1
Link to comment
Share on other sites

If I want to use the form builder for a registration form that saves to an unpublished 'user' page:

  1. Is there a way of defaulting the role to guest?
  2. Can I check whether a chosen username already exists, ie checking whether a page with template user has name=username?

Thanks!

Link to comment
Share on other sites

Is there a way of defaulting the role to guest?

It should do that automatically. PW requires a user to at least have that role, so it'll add it if it's not there.

Can I check whether a chosen username already exists, ie checking whether a page with template user has name=username

You could do this with a hook. Add this to the top of your form-builder.php template file:

$forms->addHookAfter('InputfieldForm::processInput', null, 'hookProcessInput'); 
function hookProcessInput(HookEvent $event) {
 $form = $event->object; 
 $field = $form->get('username_field'); // substitute the name of your username field
 if(!$field) return; // probably a different form you don't want
 $username = $sanitizer->pageName($field->attr('value'));
 $user = $users->get($username);
 if($user->id) $field->error("That name is already taken"); 
}

This was written in the browser rather than tested here, so may need tweaking, but let me know if you find it provides the capability you needed or doesn't?

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Hi.. Is there a way to create multiple templates for forms? I mean, separate template for each form. Please point me to the right direction.

As always, any help is greatly appreciated. :D

Edit:

I don't know why I didn't realize right away that when ryan said email "template" it meant a template with most of the api vars in it. When I got around it, it was just a matter of identifying the form name to design a layout for each of the forms. :D

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Not sure if this is the right place for feature requests but a couple of mine would be:

  • the ability to add custom attributes to inputs, for instance I like to add required aria-required="true" to required inputs to take advantage of in-built browser validation, and spellcheck="true" autocorrect="on" for textareas
  • more control over markup for radio buttons and checkboxes so that I could omit list tags and instead use fieldsets with legends for the group label
  • automatically add a 'required' indicator to labels for inputs that are required
Link to comment
Share on other sites

Basically, I want to see if I can substitute some of my client work to focus on ProcessWire instead. A lot of you have asked to make donations to the ProcessWire project.

Ryan, the concept behind PW is clearly attracting people who are fed up with getting locked out with their creativity and for them failing roadmaps with other cms'es. I am sure one of them. What are your thoughts about a second core team member for the focus on PW you mentioned ? Donations won't fit the bill, a marketplace will. Keeping the cms free it is needless to say that a marketplace will make money both for PW and coders who add professional modules. And it will present PW also in the market out there. Have a look at the marketplace of concrete5 http://www.concrete5.org/marketplace/addons/

Link to comment
Share on other sites

jbroussia wrote:

Then as we reached 2000 and nothing happened, someone did the calculation again and found it really was 2012. But in case we reach 2013 safe, they are already working on refining their parameters to get a new estimation ASAP.

Priceless :lol:

Link to comment
Share on other sites

the ability to add custom attributes to inputs, for instance I like to add required aria-required="true" to required inputs to take advantage of in-built browser validation, and spellcheck="true" autocorrect="on" for textareas

This is something that we will most likely be adding soon. 

more control over markup for radio buttons and checkboxes so that I could omit list tags and instead use fieldsets with legends for the group label

This would be a little trickier, as these inputs come from ProcessWire Inputfields rather than FormBuilder. Though I'll keep thinking about alternatives. One alternative is that it's always possible to clone an existing Inputfield, rename it, and place it in your /site/modules/. Install and modify it to produce your preferred output. 

automatically add a 'required' indicator to labels for inputs that are required

Assuming I understand correctly, we already have this. But you might have to be on the dev branch. 

What are your thoughts about a second core team member for the focus on PW you mentioned ?

I may lead the project, but we have several core team members already. All the commits still go through my account (for QA), but I'm not always the one coming up with what's in the core. 

Keeping the cms free it is needless to say that a marketplace will make money both for PW and coders who add professional modules.

I agree, and I think the Concrete5 marketplace is a good model for us. 

Link to comment
Share on other sites

  • 1 month later...

We actually do support rich text, but indirectly. It wants you to specify what page and field to pull the success text from. So basically you would create a "thank you" page in ProcessWire and populate the body field with everything you need. Then in the Form Builder, enter "/path/to/page/:body" for your success text. However, there's a better option:

Use the success redirect option instead. That way it redirects to your success page which can contain whatever you want. When using the frame-based embed options, this is preferable to having the Form Builder output any success message for you. That's because Form Builder is running from a template that may not be consistent with your site's type styles. So you can get around that just by doing a success redirect. To use the redirect option, just specify the /path/to/page/ in your success text (and nothing more).

I'm trying to use form-builder to gate resources on a site I'm working on but when I try to redirect the form submission to the pdf file, it just gives me the path as text in a box. I also tried creating a thank you page with text in the body that said "Success! Click Here!" and then link to the asset, but at first it just opened the pdf inside of the tiny iframe. I can set the link to open in a new tab, which works, but I can't style the  "Success! Click Here!" text and it has a border around it.

I love how easy Form-Builder is to use, just having some difficulties with this particular feature. Any help would be greatly appreciated!

Link to comment
Share on other sites

@chim77richalds do you have access to the Form Builder support board? If not, let me know your order number so I can update your access. Also, please post the exact text that you are pasting in the success box. 

Link to comment
Share on other sites

  • 10 years later...

Hi!

I would like to output the datetime field in the email in a different format. unfortunately i can't set that in the field setting.

The output format is: "2021-12-01 00:00"
What i need is: "01.12.2021" ... and without the Time

Is there a way to make this work?

Version: 0.5.1

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...