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
vanessa veronvanessa veron 

JS function to prepopulate an inputText

Hello
I have a JS function to prepopulate an inputText according to the outputText ...
Is not working.

Help me please!

<apex:page standardController="CronTrigger" extensions="BBpoll" >
<link rel="ic" type="image/png" href="http://www.voca.com/bull.png"/>


    
<script type="text/javascript">
function prepopulate(){
var getOPT = document.getElementById("{!$Component.theform.aaa}").value;
document.getElementById("{!$Component.theform.bbb}").value = getOPT;
}
</script>

 <apex:form id="theform" onclick="prepopulate();">
  <c:sectionHeader iconsrc="http://voc.srv1.votre-/lle.png" title="Planifiy" subtitle="=)"/>
  
  <apex:PageBlock >
    <apex:image id="theImage" styleClass="imageCenter" value="http://www.voca.com/logo.png" />
    <br /><br />
    <apex:outputText  id="aaa" value="{!$CurrentPage.parameters.nomJobPG2}" /><br />
    Nom Job.:&nbsp;<apex:inputText  id ="bbb" value="{!nomJob}" /><br /><br />

............

  </apex:PageBlock>
  </apex:form>
</apex:page>

Magdiel HerreraMagdiel Herrera
already answered to your issue here, let me know if it helps

https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AZBLIA4