How can I create a checklist from several fields?
-
My problem of understanding is this:
I have several articles with article numbers. If I create a checklist for this, I can only enter a text and the value, but no further information.
My idea: I create several fields with the article data. I enter the field name in the checklist. When I click on this, the field passes the article information. Is this possible?
- This topic was modified 6 years, 1 month ago by badmax69.
-
Hello @badmax69,
I’ll try to describe the process with a specific case.
Assuming we want to display a Radio Button field with the titles of published pages, and once the user tick one of options, I will display a textarea with the excerpt. It is very similar to your project.
– First I will insert a Radio Buttons DS field in the form (I will be call it fieldname1), that will be configured as follows:
* Select Database as the datasource.
* Leave the database connection data as default because would be used the same website’s database.
* Enter the text: ID as the attribute: “Column for values” (it is the name of the column used as the rows ids in the wp_posts table of WordPress)
* Enter the text: post_title as the attribute: “Column for texts” (it is the name of the column with the posts and pages titles)
* I’ll entre as the “Table Name” the constant: {wpdb.posts} (using the constant I don’t need to know the prefix used by the database, WordPress use wp_ by default, but it can be any other prefix)
* Finally as I want to display only the pages that are published, enter the following text as the “Condition” attribute:post_type="page" AND post_status="publish"
– Now is the moment to insert the Textarea DS, field, that will be configured as follows:
* Similar to the previous field select the database option as the datasouce.
* Enter the column name: post_excerpt as the attribute: “Column for values”
* Enter the same table name: {wpdb.posts}
* But now the condition changes, it would be:ID=<%fieldname1%>
In this case, the row to use would be filtered by the choice selected in the Radio Buttons DS field.
Your project is very similar to this example, but using the post_type corresponding to your articles.
Best regards.
OMG, I don’t understand anything except that I need the Developer Edition for this. ??
Hello @badmax69,
I’m sorry, as you have mentioned the articles, I’ve assumed you are talking about elements stored in your database, if it is the case and you need populate fields in the form with information stored in the database, you will need the Developer version of the plugin that includes the set of DS fields.
Best regards.
No, I am currently trying to check whether the plugin is suitable for my purposes. Therefore I currently only have the basic variant. I just wanted to know if it is possible to create a checklist from several previously created fields.
Hello @badmax69,
I’m sorry, but your current description is too general. If you want populate a checkbox field with the values of other fields there are different alternatives with some additional code, but every case has its particularities.
Best regards.
I have invested a lot of time in the plugin and I like it very much. Since I use it to create a few forms for a customer, I still have a few questions:
1. Can I buy the plugin and install it on my website, build the forms there and transfer them to the actual website after completion without having to buy the plugin again?
2. Can I display prices if the user is logged in or has a specific password? If it is an anonymous user, no prices will be displayed. Is this possible?
3. I have to create the forms in at least two languages. Is the plugin multilingual or compatible with WPML? Or do I have to build each form in the respective language?
Hello @badmax69,
I’ll try to answer all your questions:
Q: Can I buy the plugin and install it on my website, build the forms there and transfer them to the actual website after completion without having to buy the plugin again?
A: The feature is available only with the commercial versions of the plugin, and both websites must have installed the same version of the plugin (you can use your copy of the plugin to implement the projects of your clientes). After create the form in your local website, go to the settings page of the plugin through the menu option: “Settings > Calculated Fields Form”, select the form from the list: “Export this form structure and settings” and press the “Export” button and select the location in your computer where store the file.
After exporting the file, go to the same section in the website of your client, select the file through the attribute: “Import a form structure and settings (only .cpfm files )” and press the “Import” button.
More information in the following link:
https://cff.dwbooster.com/documentation#import-export-formQ: Can I display prices if the user is logged in or has a specific password? If it is an anonymous user, no prices will be displayed. Is this possible?
A: There are different alternatives here:
– Insert a “Hidden DS” field for reading the ID of registered user, and then display the equation’s result if the value of the field is different of zero. For example, if the “Hidden DS” field is the fieldname1, and the equation: fieldname2+fieldname3, edit the equation as follows:
IF(fieldname1, fieldname2+fieldname3, 'You must be registered');
– Second alternative, activate the “Server Side Equations” add-on and move the equation’s code to the server side (of course, in this case you will need to implement the equation using server side code: PHP), and call as part of the equation the WordPress function: wp_get_current_user(); to know if it is a registered user or not, to return the result of the mathematics operations or a warning text (https://cff.dwbooster.com/add-ons/server-side-equations)
– Third alternative, activate the “Users Permissions” add-on and configure the form to be accessible only by registered users (https://cff.dwbooster.com/add-ons/users-permissions)
Q: I have to create the forms in at least two languages. Is the plugin multilingual or compatible with WPML? Or do I have to build each form in the respective language?
A: The solution here is create the master form, and then, clone it (pressing the clone button in the settings page of the plugin), and replace the texts in the cloned forms. Each form has its own id, so, you should insert the form’s shortcode that corresponds to the language of page in the website.
Best regards.
In my first question I didn’t mean the possibility to export, but to buy the plugin only once and to transfer everything to the new website after finishing my work.
Hello @badmax69,
Yes, of course, you can install your copy of the plugin in all your websites, it is an one time purchase and not a license per website.
Best regards.
I have an understanding problem with the database. I want to create an input mask on my own page. The input is stored under wp_cp_calculated_fields_form_posts. Now I want to display them as a preselection in the input mask.
What do I enter under “Column before values”, what under Table-Name, Condition, Order by and Limit?
In the database I see: id, form id, and data. The area data is to be taken over.Hello @badmax69,
If you want the form be pre-populated with the latest information submitted by the registered user, the easier alternative would be:
– Enable the “Users Permissions” add-on from the settings page of the plugin.
– Configure the form to be submitted only once per user, but assign the users permissions for editing.The alternatives require more complex queries. For example, assuming you want populate the fieldname123 field in the form=2 with the latest value entered into this field:
– Enter in the “Column for values”:
REPLACE(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(paypal_post, ‘fieldname123’, -1), ‘;’, 2), ‘:’, -1), ‘”‘, ”)
– In the table name:
{wpdb.prefix}cp_calculated_fields_form_posts
– In the condition:
formid=2
– Order by:
id DESC
– Limit:
1
Best regards.
The plugin is outstanding and your support is the fastest and best I’ve ever seen. That has to be said. ??
I have now created an input mask that writes the data to the database as you described above with your alternative.
In another form I want to access this data. I have created a Hidden DS field. Can I now use this result as a value in a checkbox? For example: Selection 1 … Text is ***, Value is fieldname10, Selection 2 … Text is ****, Value is fieldname11. Is this possible?
Hello @badmax69,
In the settings of the DS fields you can select the custom query option and create queries as complex you need, but you should know sql because in this case should be concatenated the results of different queries using “UNION”
(SELECT 'text for first option' as text, REPLACE(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(paypal_post, 'fieldname10', -1), ';', 2), ':', -1), '"', '') as value FROM {wpdb.prefix}cp_calculated_fields_form_posts WHERE formid=1 order by id desc limit 1) UNION (SELECT 'text for second option' as text, REPLACE(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(paypal_post, 'fieldname11', -1), ';', 2), ':', -1), '"', '') as value FROM {wpdb.prefix}cp_calculated_fields_form_posts WHERE formid=1 order by id desc limit 1)
In the previous queries you should replace the texts and the id of form.
Best regards.
I created an input mask with your code
REPLACE(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(paypal_post, ‘fieldname123’, -1), ‘;’, 2), ‘:’, -1), ‘”‘, ”)
In the beginning it worked perfectly. After copying several of these areas and adjusting the field names, for example, the first input mask now takes field 28 instead of field name 2, field name 39 in field 3, and so on. I think it’s a simple solution for you, an impossible one for me.Hello @badmax69,
If you need that I implement your project, I can offer you a custom coding service from my private website:
https://cff.dwbooster.com/customization
Best regards.
- The topic ‘How can I create a checklist from several fields?’ is closed to new replies.