You need to sign in to do that
Don't have an account?
Masie Maseli
Display input fields based on a number field
Hi,
I have a visualforce page where a person can create new contacts. I would like this to be more dynamic so based on a field with a value I would like the page to render the exact amount of fields needed to be filled in. So if the number field says 1 then the page must provide space to only create one contact and if the number field says 10 then the fields to create 10 contacts should be shown.
Is this possible?
I have a visualforce page where a person can create new contacts. I would like this to be more dynamic so based on a field with a value I would like the page to render the exact amount of fields needed to be filled in. So if the number field says 1 then the page must provide space to only create one contact and if the number field says 10 then the fields to create 10 contacts should be shown.
Is this possible?
<apex:pageBlock title="Give number" id="giveNUM">
<apex:pageblockSection columns="1">
Number of rows : <apex:inputText value="{!rows}" />
<apex:actionSupport event="onchange" rerender="Rowsforcontact" />
</apex:pageblockSection>
</apex:pageBlock>
<apex:pageblockSection id="Rowsforcontact"> //use this to show contact rows
Similar code present on the blog, tweak it as per your requirement:
https://prats23.wordpress.com/2014/04/27/salesforce-dynamically-addingdeleting-rows-in-visualforce/