How to create additional textboxes on lookup filed change

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
dspark
Posts: 5
Joined: Fri Feb 23, 2018

23 Feb 2018

Hi all,

I'm trying to create a purchase order form. In the new form, user should choose some products from another list (called Products). It's done by using a lookup field. But after choosing one or more products, before submitting the form, I would like the user to enter quantity information for each product that he/she selected.

For example; If the user chooses two products like seen below, I would like the create two textboxes where he/she can enter the quantity information for each product. Is there any option within the form designer to achieve this? Or may be I'm approaching this situation from a wrong angle, any other opinions are welcomed :)
1.PNG
1.PNG (1.88 KiB) Viewed 1768 times

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

26 Feb 2018

Dear dspark,
It's impossible to add fields dynamically as all data is stored in SharePoint. What you can do instead is to create additional columns in the List, hide them by default and each time there is a change to the Choose Products field, see how many products are selected and display that many fields.

This shouldn't be hard to implement, but the issue is that I don't know how many products a user can select. If it's just a few, then it shouldn't be a problem. If there can be lots of products selected, not only will this require you to create many fields, but this will also slow down the form and we don't recommend using more than 70 fields per form in general as there is a limit to how complex the forms can get.

How many products would user be able to choose from? Do you want to have a field named for each product?

If there will be a lot of products to choose from, I would simply recommend to use Related Items instead. This will allow you to have Children items tied to the Parent form where user will be able to select one product and quantity in a table. So, it will only need a single value Lookup and Quantity field, not much more. It can also be shown on the form in the Quick Edit mode, so the user can simply add as many products as necessary with user friendly interface.

Read here about binding Children to Parent - https://spform.com/documentation/relate ... -edit-mode
I recommend you to figure out what it does and how to configure it first by following the example, then start implementing it for your own scenario.

Let me know if you'll have any questions!
Cheers

dspark
Posts: 5
Joined: Fri Feb 23, 2018

28 Feb 2018

Hi,

Thank you for your reply. As you mentioned, it will be a better idea to use children - parent setup.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests