• tvejacques

    (@tvejacques)


    How would one do this in WordPress without coding?:
    * There is a single form field input box for a phone number.
    * There is an Add Another button
    * When clicked, another input box appears to add another number
    We’ve done this before coding PHP/JSON etc.
    I’m just wondering if there is a simpler WordPress way to do this.

Viewing 8 replies - 1 through 8 (of 8 total)
  • threadi

    (@threadi)

    I’m just wondering where exactly you want to extend a form? WordPress actually only provides the comment form for the frontend. Everything else is made possible by plugins. In the backend, for example, there is a form for managing user data – is that what you mean?

    Thread Starter tvejacques

    (@tvejacques)

    Thanks for replying threadi

    What I described is on the user side, when entering his information. We need to allow for several phone numbers for the same user (separately), and do not want to clutter the UI. So to start with we display only one input box for the phone number.

    We’ve done this successfully in the past (not with WP). The user enter his phone number, and if he wants to add another phone number, he clicks “Add another number”, and a new instance of the same input box is added to the UI (without submitting the form). This process can theoretically continue ad infinitum.
    We know how to do this with PHP, table designs, and necessary front-end scripts.
    So my question really is, is there a WP shortcut to do his, or must we delve into the engine room to do this?

    threadi

    (@threadi)

    Then the crucial question would be which form plugin you use to provide the form in the frontend where the user can enter something? A link to the page could help you to recognize this.

    Thread Starter tvejacques

    (@tvejacques)

    Thanks threadi
    We do understand that the basic WP installation cannot handle this and would require a form plugin.

    It seems that my post heading is a poor one. Our basic question is more about user-side element creation, and then following on that the question related to forms.

    There seems to be two aspects of importance for our case:
    * The ability to create a block (or perhaps rather element within the block) on user side and reveal that for various purposes when needed – but without a trip to the server. With this reveal we do not mean with the basic conditional method to hide and reveal, but rather the creation of a new instance on user side. As the same type of function will be used for many other use cases, we’re looking for such a method – which is why we posted the question here in WordPress Support. So we’re looking for something that can “build” something on user side, and were wondering if there is a basic WP method to do this.

    * For data input a form plugin will certainly be required.
    Our form-related question is whether in cases where a block/element is created on user side for the same field, will the basic functionality of a form plugins pass the input data correctly to the data table? – as there will be more than one data inputs on the same field on the same page on the same trip to the DB server.
    Will the automatically installed set of data tables of the WP install handle this without tinkering?. Or would we need to tinker with the DB – such as creating additional tables with foreign keys?

    We haven’t yet decided which form plugin to use. We still need to research and review. Any suggestions?

    Our experience with WP plugins has been (surprisingly) very poor. We’ve had to trash more than 10 plugins thus far that we bought for different functions due to conflicts with other plugins – typically with basic block building plugins (of which we tried several ones too). That despite we tried “best voted” plugins. We do some development, then a conflict arises; then troubleshooting; then trashing the culprit, and start again. And when we need to trash the block plugin, then we need to re-develop those bits. Lots of time wasted. (I won’t get into naming culprits here).

    We’ve wasted a frustrating lot of time troubleshooting conflicts. In this regards we’re sorry we tried the WordPress solution – we thought it would save time. It would have been much quicker to start our development from scratch with PHP.
    It seems that WP is great for typical installations (such as brochureware and shopping), but the moment one wants to do something out of the norm, diving into coding is better.

    threadi

    (@threadi)

    I still don’t quite understand your goal. You describe it far too abstractly and try to think of solutions that you may not even need.

    Could you give a concrete example of what you want to enable visitors to do with the form in the frontend?

    If this is not possible, I can only refer you to the list of form plugins: https://wordpress.org/plugins/tags/forms/

    If that is not enough, I would recommend finding someone who can help you personally with your request. You can find someone like that here, for example: https://jobs.wordpress.net

    Thread Starter tvejacques

    (@tvejacques)

    Your responses are appreciated, threadi

    1. The following is easy to do in WP for the frontend:
      * Some information is displayed on the public user side frontend
      * Click + sign and more info appears.
      This happens without requiring a request from the server to add.
    2. Now extend that feature to this:
      * When clicking the + sign, a block is duplicated on the user side, without a trip back to the server. It is not in the “package” of the first page request. It is created during the session and added on the fly (so to speak). There must be JavaScript to do that.

    Is #2 possible?
    * What is the WordPress lingo/terminology for this type of function?
    * Will some kind of plugin be needed to do this? What type? We have not come across how this might be handled in any of the documents of block building plugins.

    The second part then:

    If that block creation as in #2 is possible, and the block created on user side contains form data, we’re just wondering if there might not be confusion.
    Here is the input box: it contains the ID of the database field into which the data must be added.
    Now if it is possible to have that block created user-side that contains another input box, to send the data to the correct table field, that second block will contain the same ID as the first block.
    So two data strings with the same field ID will be send in the same session.

    Will WP handle this properly? Will WP add the first string first and the second one secondly without having to building the necessary code-level measures?
    Our confusion about this is because we do not know the structural architecture of WP’s table constructions and relations. But if we need to get into such technical details, it is often easier to build one’s own tables than to try to understand tables designed by others.

    Our project can use table designs from a project of 20 years ago, but then we would loose functionalities provided by WordPress.

    threadi

    (@threadi)

    I’ll try to put what you wrote into my own words with a really concrete example:

    When you access your site, you have an FAQ in front of you, which is displayed as a list. The entries in this have a “+” before or after their title to indicate that you must click there to view more information. If you click on it, this information will be loaded from the server and then displayed.

    Now you want to extend that. In addition to the additional information that is loaded from the server for the FAQ entry, a form should be displayed through which the user can send individual feedback on the FAQ entry.

    So, your challenge now is how to display this form. Have I summarized the content appropriately first?

    Overall, from a technical point of view, this would be quite feasible. You definitely need a form plugin. How you then connect this with the entries depends on how you currently display them on the website. Since you didn’t show any concrete example, I can only say in general: feasible.

    By the way, your request has absolutely nothing to do with the WordPress database structure or tables. Your wish must be able to be fulfilled primarily by the theme you use. But since I don’t have any information from you about this, I can’t say anything further.

    I would also recommend that you look for someone who can support you personally (see link above). Without concrete examples and a link to your site, we can only help you with general statements.

    Thread Starter tvejacques

    (@tvejacques)

    Much appreciated threadi

    Yes, your summary is something of what we’re looking for. But not totally. We are trying to avoid trips to the server, which is why we can’t use the “standard” WP function – the one you explained.
    On the theme: we use the default 2024 theme, but build our own patterns and template parts, thus not really using the theme except to serve as some kind of foundation in order to avoid getting too deep into coding.
    Due to all the plugin problems we have experienced, we halted further development. We were two month down the line when some really big problems began – due to conflicts. We will need to rebuild some basic foundations. Now we’re focusing on testing plugins, building small testers to avoid problems down the line again.
    So for now we are satisfied with your response and we can close this.
    BTW: our proof-of-concept site (using pseudo-code) was not done in WordPress. We need to translate that into the WP environment – but as the saying goes: things get lost in translation 🙂
    Thanks again for your time and effort trying to help us.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.