Dynamic Form Fields - forms

I'm not exactly sure what to call the thing i am searching for. If I knew what to call it I might find the answer, so if you have an answer to my question or even know what I can search for that would be very helpful.
I am trying to create a simple php form that has standard fields like name, email, etc. I want to add an event type field that is a drop down with pre-selected values (i.e wedding, birthday, etc). Once they select a particular event I want other options to appear.
For exmaple they would select wedding and then date, venue, etc would then come up. If they selected birthday, then different additional options would appear.
Does anyone know the technical term for this, or where I can find a tutorial on it? Does it require ajax or jquery or something else?
Thanks for your help.

You could do this with jQuery. It sounds like you want more than just dynamic select (drop down) inputs. You could check this blog post out, but that really only covers the drop down fields.
It sounds like you want something fairly custom. You could separate your form into the individual steps and hide many of the fields to start. With jQuery, you can apply event handlers to fire functions when something is selected and then the function would determine what fields to show.
You don't really need to use AJAX unless you need the options (specifically drop downs) to contain options which are pulled from a dynamic source (e.g. a database).

Related

formio: How to populate fields without custom javascript code?

I have searched for hours and tried several approaches. No luck.
Scenario:
There is a formio Resource Form for Doctors that includes the Doc's practice number, name, address, etc.
A new form is created for prescription medication. The form has a Select component to find the doctor's practice number. Once the correct doctor is selected, the fields showing the Doc's name, surname, address, etc., must be automatically populated.
I understand that anything is possible with custom code, but this is such a common requirement that I'm convinced it can be done with standard functionality.
Can you show me how to do this?
Thanks,
Alan
In the validation tab, do a custom validation.
Using the drop down's value, look up the doctor's information.
Then, use the following code as a guide to update your fields.
FormioUtils.searchComponents(form.components, {key:"address"})[0].setValue("PO Box 123");

Backpack crud field that displays an included filtered table

I need to make a new type of field, let's call it included_table. If in Model employees I have a field of type select2 from model Departments, in Departments, I want to have a field of type included_table which displays the table of the employees from that department, in the same way as the crud does.
Is there an easy way of doing this? Or what would be the best way to start?
Thank you.
I don't think there's an easy way to do it. You'd have to code it yourself. You can start from the table field type, put it won't get you very far.
That's because it's a lot more complicated that it looks at first glance. Keep in mind that Backpack create/update forms work with refresh; if you put a table inside one of them, the expected behaviour might be to only "save" the information when you click the final "save" button; but you probably can't do that for the nested entity, because you'd be saving it with AJAX. Plus, you need to build that entire AJAX functionality yourself, including validation. It's not at all more difficult than using plain old Laravel - it's exactly the same. But Backpack won't help very much in this regard.
That being said, you'd probably be better off just putting a button in the list view for each Department, to go edit its employees. That's a lot easier to do, if you follow the nested resources tutorial.
Hope it helps.

Best Product Listing Option for Concrete5

I'm going to be creating a Concrete5 website that will feature product listings. The listing system must offer all your typical ecommerce features, minus the ability to purchase items. It's strictly for browsing purposes only.
For example:
- Browse by category
- Search products
- Listings/results page with thumbnails and brief information (title, description, price in US/CAD, manufacturer, maker, etc.)
- Products single page (with detailed information, attributes and gallery/images)
All the things you'd expect to find in a listing system.
My issue is I can't find a specific add-on for something like product listings. This leaves me thinking that it may be best to use the e-commerce add on and do my best to hide anything related to the cart/payment process. That way it could just be used for everything else it offers.
What are your thoughts on this? Is there a better option?
Thanks for the advice!
Use the page list block. It has everything you need except for searching. But, in essence, that's what your requirements call for -- listing of pages.
Create a page type for your "product". The "brief information" can be in the Content block, or you can set as attributes. You'll probably want to make some minor changes to the block's view (by creating a new template) that displays the image as you want, the proper attributes, etc. Something similar to http://www.concrete5.org/documentation/how-tos/designers/styling-the-page-list-block/
There are several adanced page list blocks in the marketplace. You might want to start with those.
Right creat Page type.
After creat Page attributes.
Add a block page_list create a template for it and filter by attributes.
You can even use ajax to filter.
http://www.weblicating.com/doku/doku.php?id=cheatsheet/#.UbR7P0BmiSp
U can find here about page_list or read documentation Concrete5.

Wordpress Gravity Forms - Dynamic population

I have a gravity form on my site that looks like this:
Activities:
[checkbox] Brand
[checkbox] Retailer
[checkbox] Other
Tags:
[Text input]
I want to dynamically fill the text input with the selected activities, so for example when Brand is selected it places Brand into the text input.
Is this possible with dynamic population? If so is there any tutorials for me to follow? I've been able to find how to dynamically populate using the page URL but nothing like this but imagine it has to be possible…
Cheers!
Nick
This is possible with Gravity Forms Copy Cat. Here's what it looks like:
Correct me if I am wrong, but I believe the dynamic population of an input in Gravity Forms has to come from a pre-established piece of information. You can write a custom filter to pre-populate the field on page load, but that info has to come from somewhere. It needs to already be established. With PHP it is fully processed on the server when the page loads, so I don't think you can watch for the checkbox to be clicked and then dynamically populate the field just from a Gravity Forms filter. I believe you would need to implement some custom JS or AJAX to accomplish this. I'll mess around with GF a bit and see if I am wrong or can find another way of doing what you're after. Maybe someone else can better answer this in the mean time.

Design ideas for multi-select items from a long list

I'm developing a system in which I need to select, from a long list os customers, some to which an specific (batch) action will be executed. For example, I want to select "John", "Peter" and "Steve" and click the "delete" button. No more than 5 customers will be selected.
The problem is that, since there're more than 500 customers, listing all isn't a good option. So far I did an AJAX search that shows just the customers that meet the criteria, but which multiselect way you recommend?
My best idea so far is a below this list in which I could either drag-and-drop the users I want to select or double click them
Any better ideas/examples?
Thanks
I don't know whether you're using jQuery, nor whether your site's design vocabulary is suited to it -- but this jQuery autosuggest plugin is excellent.
+1 for ksr's autosuggest find. I would use this in conjunction with a list box. The user types in the autosuggest input field and when they select an item it adds it to a list box. They can then add additional names via the same method, and submit the list when they've added all the names.
I would go for the pattern used by eBay. They probably did some usability research. You can find more info here: http://quince.infragistics.com/Patterns/Multiple%20Selection%20from%20a%20Large%20List.aspx