mardi 16 juin 2015

how can i get h:outputText (jsf primefaces) value in my javascript [duplicate]

This question already has an answer here:

.xhtml 
    <p:column headerText="Qt dispo" style="width:30px">
                    <h:outputText value="#{a.quantite}" style="font-weight: bold" />
                </p:column>



       my javascript 
                    <script type="text/javascript">
                function checkPasswords() {
                     var x = document.getElementById('f:q').value;
                     var y = $("[id='f:c']").;



                    if(x &gt; 1) {

                        alert(y);


                        return false;
                    }

                }
        </script>

i used the javascipt code above but i didn't work when i display the y variable it shows me object Object, my purpose is to get the value of the h:outputText so i can test it with the x variable

Aucun commentaire:

Enregistrer un commentaire