You need to sign in to do that
Don't have an account?
Antonio Jesús Criado Manzaneque
Document.getElementById - Can't get the element within apex:repeat element
I'm trying to get an outputlabel to change its value but it's turning me crazy, somebody could help? thanks
<apex:page> <apex:form id="theForm"> <apex:pageBlock id="thePageBlock"> <apex:repeat value="{!servicios}" var="servicio" id="theRepeat"> <script type="text/javascript"> //alert('Cliente: {!servicio.id}'); document.getElementById('page:theForm:thePageBlock:theRepeat:0:motivo').value = 'PROBANDO'; </script> <table> <tr> <th><apex:outputText value="{!servicio.mel_rel_proveedor__r.name}" id="theValue"/></th> <th></th> <th><apex:commandButton value="Boton 'Interesado'" action="{!prueba}"/></th> </tr> <tr> <th class="cabeceraServicio">{!servicio.name}</th> <th class="cabeceraServicio"></th> <th style="display:none;" class="cabeceraServicio"><apex:commandButton value="Boton 'Interesado'"/></th> </tr> <tr> <td>Ofrecido</td> <td><input type="checkbox" id="cbox1" value="ofrecido"/></td> </tr> <tr> <td>Cliente interesado</td> <td><apex:outputLabel value="" id="interesado"/></td> </tr> <tr> <td>Motivo No Interesado</td> <td><apex:outputLabel value="" id="motivo"/></td> </tr> </table> </apex:repeat> </apex:pageBlock> </apex:form> </apex:page>
You have to use your code some thing like below,
you have to call this Javascript fucntion from event of any button click or page load. otherwise the function will not be called.
Hope this will help you.
Mark Best ANSWER if its works for you.
Thanks
karthik