function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Puja Patil 13Puja Patil 13 

When i click on add button i need to display one more textbox and create new record for object

Hi,
Good Morning.
can any one help me to solve the following.........
I have an object student__c. It has only one field name.i would like to add the records into object using VF page. Initiallay, In VF page I have Add button,Save button & a text box. When i click on add button i need to display one more textbox. Like this i can add any number of textboxes. But when i entered data into these textboxes and clicked on save. I would like to add all the names into object in the form of records. That means, each name will be added into object as a record. i need controller class also Can any one help me.
Best Answer chosen by Puja Patil 13
Virendra ChouhanVirendra Chouhan
You mean, whenever user click on Add button a new field will create on Student__c object and whatever value user enter on that new field will store on the same record's latest field ?

If yes, then whats the bussiness need for  the same? I mean why you want to created fields from VF page?

All Answers

Virendra ChouhanVirendra Chouhan
Hi Puja,

You want to add rows dynamically and then insert it into your object. below link will help you to solve this requirement:
http://sfdcsrini.blogspot.com/2014/12/adding-and-deleting-rows-dynamically-in.html
Puja Patil 13Puja Patil 13
Hi Virendra,

Can we create new field on the existing record..? when we click on button it display new text field as well as i want to create new field on existing object record...
 
Virendra ChouhanVirendra Chouhan
You mean, whenever user click on Add button a new field will create on Student__c object and whatever value user enter on that new field will store on the same record's latest field ?

If yes, then whats the bussiness need for  the same? I mean why you want to created fields from VF page?
This was selected as the best answer
Puja Patil 13Puja Patil 13
yes ...

I have the Object Question__c... It contains Question and Options for that . When i am click on Add button more options can be added for that question.. Initially i have 2 options for every question. 

 
Puja Patil 13Puja Patil 13

Thanks Virendra..

I get  yout point. I will discuss it with my seniors.