+ Start a Discussion
Katta RahulKatta Rahul 

How to send data from one <apex:form> to another <apex:form> in same VF Page?

Hi All,

I have 4 sections(i.e., <apex:form>) in a VF Page. Each apex:form has a "rendered" tag associated. On the first form, I have submit button that calls a Javascript and that calls an <action:function>. Which renders the second form. I have a pagereference in the controller class that controls this functionality.

Now I have the 3rd <apex:form>,  that has <input> fields in it. I am taking all the input values and calling a remoteAction function, after that I need to prepopulate these values in form4. When I am calling the method using <actionFunction> I am losing the data.

How do I capture that data in  form4?

Thanks in Advance!!!
Best Answer chosen by Katta Rahul
SonamSonam (Salesforce Developers) 
If I understand the requirement correctly: the 4 forms you have created are renders on submission of the previous form: form 2 renders on form  submission and so on..
 
I suppose you can use a single form in this page(which is also a best practice) and achieve this using https://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_actionSupport.htm
and https://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_actionFunction.htm

All Answers

SonamSonam (Salesforce Developers) 
If I understand the requirement correctly: the 4 forms you have created are renders on submission of the previous form: form 2 renders on form  submission and so on..
 
I suppose you can use a single form in this page(which is also a best practice) and achieve this using https://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_actionSupport.htm
and https://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_actionFunction.htm
This was selected as the best answer
Katta RahulKatta Rahul
Thanks Sonam it worked!!!