Não estou conseguindo pegar o valor de um campo usando getElementById:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>Gerador de Apostas</title>
<script language="JavaScript">
function doValidation(){
int i = document.getElementById("form1:qtdeNum").value;
alert(i);
}
</script>
</h:head>
<h:body>
<h:form id="form1">
<h:panelGrid>
<h:outputLabel value="Quantidade total de números:" for="qtdeNum"></h:outputLabel>
<h:inputText value="#{geradorDeApostasBean.quantidadeDeNumeros}" id="qtdeNum"></h:inputText>
<h:outputLabel value="Quantidade de números por aposta:"></h:outputLabel>
<h:inputText value="#{geradorDeApostasBean.tamanhoDaAposta}"></h:inputText>
<h:outputLabel value="Quantidade de apostas:"></h:outputLabel>
<h:inputText value="#{geradorDeApostasBean.quantidadeDeAposta}"></h:inputText>
<h:commandButton action="#{geradorDeApostasBean.geraApostas}"
value="Gerar" onclick="doValidation();"></h:commandButton>
</h:panelGrid>
</h:form>
</h:body>
</html>