Is it possible to have a "load more" button on a Contact Form 7 form that would just duplicate another field set on the form? I need to create a form that will allow restaurant owners to enter each item on their menu, and was wanting to display something like the following:
Item title (text field)
Menu section (dropdown -- appetizer/entree/side/dessert)
These fields would then be followed by a "load more" button that, when clicked, would generate another Item title/menu section field set. The button would need to be indefinitely clickable to generate as many field sets as needed for the user to enter all of their menu items.
I've seen the CF7 Conditional Logic plugin, but it seems like I'd have to specify how many additional "hidden" field sets I'd want, and the number of them available to the user would be finite depending on how many I added to the back end form. I need the field sets duplicated/generated on the fly.
Any help is appreciated, and please go easy if I'm not posting correctly or in the right area. This is my first time posting here :)
Related
I am working on a search bar in the header. The search bar has 2 input fields, and to search through the products requires both values to be inputted (eg user is looking for a battery with 12volts and 10 amp/h).
The first input field (volts) will have a dropdown for the volts which will only have 4 different values to choose from. These values are already set within the metadata and when the user clicks inside the input field this dropdown will show up straight away with the 4 values to choose from.
The second input field however (amp/h), has a dropdown with about 30 values to choose from. I want this dropdown to be hidden until the user begins to type which value they are specifically searching for, then the dropdown will be visible with a reduced amount to choose from.
I have coded the first input field (volts), i just don't know how i can get the second one to be the way I have described above. I also am unsure how to make it actually search through the products based on the values the user inserts into input field based on what they click from dropdowns, but this can be sorted at a later date once functionality is sorted.
Any help will be greatly appreciated!
This is a very specific issue and I actually have no idea where to start. I am not sure if I am allowed to ask a question like this if I don't really have any code?
I am trying to create an html form where you can enter in a location, name, address, phone number etc. Once you have filled that "location" out you can click a button that says "Add New Location". When you click that it will add another empty form where you enter in your information for the next location and can continuously do this... say you have 40 locations... you could do it 40 times.
Is this even possible with html/css/js? Or would this need to have a database and more intensive development?
I 'm currently creating a widget in Odoo 10. It has a button and an user can click on this button and then, a dialog will appear, allow user to choose multiple records and add them to a corresponding One2Many field. For example, I can choose multiple products and add them to a new sale order, the corresponding order lines will be added to the sale order as if you use the original Many2One widget, and add these products one by one. Furthermore, The added order lines will only be saved when you press save button.
My widget currently can allow user to choose multiple records, but I don't know how to temporarily add them to the One2Many tree using Javascript. I noticed that every One2Many field has an dataset property, but I have no idea what to do with it. Can any one suggest me what should I do to achieve this feature? Thank you in advance !
Good day programmers. I am very new to jsp/javascript but this site has helped me a lot so far, but i can use some more help or guidance for a problem i am having.
I am making a web app for creating and saving recipes. For my "add recipe" process, i have the user enter a recipe name, they are then directed to another page where they can choose an ingredient from a dropdown (populated from a sql db), enter a quantity, and then click a button to ad another ingredient.
What i wish to do is have the ingredient selected and the amount displayed to the user on the same page where they are choosing the ingredients. I also want to add a button at the end of the "print out" that allows the user to remove that ingredient.
So far i am thinking that i should use a table and have a row created when the user adds an ingredient, then use the deleterow() method to remove that ingredient if desired.
Does anyone think this can work? or have a better solution.
PS: i am very new to jsp and javascript.
thanks in advance for any assistance rendered.
You can use ajax to achieve this. For that using jQuery will make you writing a lot less number of lines of code.
So it will work like this, they have entered the recipe name. Now using onblur on that field input, you load the dropdown of ingredients and give them option of entering quantity and selecting the ingredient with a button to save that data.
When they click on the button to save, after it getting saving into the database, you make an ajax call to load the recent added item with a button to delete it and when they click on delete, you make another ajax call to the database to delete it.
Here is a guide to ajax on javaScript
https://developer.mozilla.org/en-US/docs/AJAX
I have 20 items of the same type in a database. Each of the items has a row ID, name, description, and section (A or B).
I have a web page that displays this information and allows the user to change the section attribute for each item. The web page display has a pane for each of the two sections, section A and section B, and each section contains a button and a hidden field for each item in that section. A button's label text is the item's name. The hidden field is used to capture the corresponding item button's section (A or B).
When the user presses one of the item buttons in the section A pane, the button is moved to the section B pane and the button's hidden field is updated to 'B'.
Likewise, when the user presses one of the item buttons in the section B pane, the button is moved to the section A pane and the button's hidden field is updated to 'A'.
At the bottom of the form is a submit button. When the submit button is pressed, all 20 hidden fields containing their associated button's section (A or B) are posted and the php server-side script updates the database for each button accordingly.
In such a case, is it best practice to use AJAX to maintain the state of the items on the server or hidden fields coupled with pure client-side javascript to maintain the state of the items prior to the form post? Why?
Thanks in advance.
In my opinion, it's better user experience to use AJAX and update the section. This saves the user from having to click the submit button after all selections have been made. Also, much simpler because you don't need to store these prior states in a hidden field or in session. You can just do the update in real time.