Olá pessoal....
estou montando a tela com XML, e validando a seleção de uma das opções, mas não estou conseguindo recuperar qual o valor da opção selecionada...
fonte JS de validação:var umaOpcaoEnvioSelecionada = false;
var elements = document.forms[0].elements;
for(var i=0,e; i<elements.length,e=elements[i]; i++){
if(e.name == 'tp_opcao_envio'){
if (e.checked) {
umaOpcaoEnvioSelecionada = true;
alert (e.value); //ocorre undefined
}
}
}
if (!umaOpcaoEnvioSelecionada) {
alert('Deve ser selecionada a opção de envio.');
return false;
}
<fieldset>
<xsl:for-each select="/dados/opcaoEmissao/opcao">
<input>
<xsl:attribute name="type">radio</xsl:attribute>
<xsl:attribute name="name">tp_opcao_envio</xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="@id" /></xsl:attribute>
<xsl:if test="selecionado=1">
<xsl:attribute name="checked">true</xsl:attribute>
</xsl:if>
<xsl:if test="desabilitado=1">
<xsl:attribute name="disabled">true</xsl:attribute>
</xsl:if>
</input>
<xsl:value-of select="text()" />
</xsl:for-each>
</fieldset>
não sei mais o q fazer.... se puderem me ajudar :$