You need to sign in to do that
Don't have an account?
vanessa veron
function JS dont work
I have a JS function but it dont work, WHY?
RESULT: into inputText --> undefined
But I have the value outputText into inputText
Thank you
RESULT: into inputText --> undefined
But I have the value outputText into inputText
Thank you
<apex:page standardController="CronTrigger" extensions="BBBB" > <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.block01.aaa}").value; document.getElementById("{!$Component.theform.block01.bbb}").value = getOPT; } </script> <apex:form id="theform" > <apex:PageBlock id="block01"> <apex:outputText id="aaa" value="{!$CurrentPage.parameters.nomJobPG2}" /><br /> Nom Job.: <apex:inputText id ="bbb" value="{!nomJob}" onclick="prepopulate();return false;"/><br /><br /> </apex:PageBlock> </apex:form> </apex:page>
All Answers
the outputText visualforce component generates a span tag, so you'll have to fill it using html content rather than value like you'll do it with an input,
also your code here needs some improvements and run away from using generated visualforce ids as it'll easly break your code if the structure changes,
this is what I recommend,