4

So I want to create an Order form for my products list in Drupal 7, I'm using Entity form module, I have a prepopulated checkbox list widget to show all my product's node title as checkbox. What I want is if anyone checks a checkbox a textfield shows up to add the amount he wants to offer. I tried Conditional fields module too but it kind of doesn't work for my case because there will be more products added to the list and I cant add textfield to it manually and it will be a massive waste of time to do that.

I appreciate any suggestions and approaches or any other modules you might recommend.

1

If you need to show a field when something gets checkked, you could just use JS to display a hidden field.

My approach would be to make custom table form that has the required input field as hidden. Then add javascript event listener to checkboxes that show the input at that row.

Then just do the normal validation and submit callbacks to update entities based on rows which are checked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.