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
FFAAFFAA 

How do I submit output text to record?

When the page loads there will be an output text that is generated into an input field. I want that value to be submitted into salesforce. The content loads into the boxes, but it won't submit to the lead record. 

 

<body onload="XYZ()"> 
 </body>   
    <apex:form > 
    <br/><br/> 
    <apex:actionFunction name="lg" action="{!iTEST}" rerender="jsvalues">
    <apex:param name="lt" value="" assignTo="{!valueLt}"/>
    </apex:actionFunction>
        <apex:outputPanel id="jsvalues">
        <apex:outputText value="Value lt:{!valueLt}" /><br/>
         <input type="text" name="{!Lead.Lt__c}" value="{!valueLt}"/>
    </apex:outputPanel>
    </apex:form>
  </apex:define> 
  <html>
<body>
digamber.prasaddigamber.prasad

Hi,

 

You can user

 

<apex:inputHidden value="{!inputValue}" id="theHiddenInput"/>

 

to make this field available for controller class to insert it into salesforce and user the same field in <outputText></outputText> to let user see it.

 

Let me know if you have any specific question about it.

 

Happy to help you!

 

Regards,

Digamber Prasad

PremanathPremanath

output Text value your getting from class only Right?

 <apex:outputText value="Value lt:{!valueLt}" /><br/>

 

valueLt you can save in your Records when Action performs.

 

Easy

 

Prem

FFAAFFAA

So this right here does exactly what I want it to, EXCEPT I get my "authorization restricted" Page when I test as Public User.

 

<body onload="TEST1()">
</body>
<apex:form >
<br/><br/>
<apex:actionFunction name="TEST2" action="{!TEST3}" rerender="jsvalues">
<apex:param name="lt" value="{!valueLt}" assignTo="{!Lead.Lt__c}"/>
<apex:param name="lg" value="{!valueLt}" assignTo="{!Lead.Lg__c}"/>
</apex:actionFunction>
<apex:outputPanel id="jsvalues">
<apex:inputText value="{!Lead.Lg__c}"/>
<apex:inputText value="{!Lead.Lt__c}"/>
<apex:inputText value="{!Lead.Company}"/>
<apex:inputText value="{!Lead.LastName}"/>

<apex:commandButton value="save" action="{!save}"/>
</apex:outputPanel>
</apex:form>
</apex:page>

 

If I display  value="{!valueLt}"  on it's own there is no issue. What I am trying to do is to get  "{!valueLt}" into <apex:inputText value="{!Lead.Lg__c}"/> That way when the Public user hits the button It can load into database. 

 

I have made everything public that I am aware of: site, page, sharing, group, profile, etc.