Radiobutton inside the popover is not checked via javascript

Asked

Viewed 95 times

0

I have a query screen where I feed an html table with the database records. In one of the columns, of each row, there are some options like edit, delete, add photos and another option that opens the Popover.

This Popover is from Bootstrap 3, when I open the Popover of some line shows 3 radiobuttons and in their onclick runs a script in the database without updating the page. I want the selected radio to be checked without having to refresh the page, but I’m not getting.

inserir a descrição da imagem aqui

Follows the code:

<td class="col-small center">
<div class="action-buttons">                                    
<a class="popover-dw" href="#" data-popover="true">
  <i class="fa fa-cog bigger-130" data-toggle="tooltip"></i>
</a>
<div class="popover-content" style="display:none">
  <form class="marcarComoVendidoAlugado">
    <div>
      <p>
        Anúncio: <%=rsAnuncios("id")%>
      </p>
      <p>
        <input <%=checkNone%> type="radio" name="vendidoAlugado" id="none<%=rsAnuncios("id")%>" onclick="alugadoVendido('src/rotinas/rotinas.asp?acao=Vendido&id=<%=rsAnuncios("id")%>&tipo=none&idInput=none<%=rsAnuncios("id")%>', 'none<%=rsAnuncios("id")%>');" /> NENHUM
      </p>
      <p>
        <input <%=checkVendido%> type="radio" name="vendidoAlugado" id="marcarComoVendido<%=rsAnuncios("id")%>" onclick="alugadoVendido('src/rotinas/rotinas.asp?acao=Vendido&id=<%=rsAnuncios("id")%>&tipo=vendido&idInput=marcarComoVendido<%=rsAnuncios("id")%>', 'marcarComoVendido<%=rsAnuncios("id")%>');" /> Marcar anúncio como VENDIDO
      </p>
      <p>
        <input <%=checkAlugado%> type="radio" name="vendidoAlugado" id="marcarComoAlugado<%=rsAnuncios("id")%>" onclick="alugadoVendido('src/rotinas/rotinas.asp?acao=Vendido&id=<%=rsAnuncios("id")%>&tipo=alugado&idInput=marcarComoAlugado<%=rsAnuncios("id")%>', 'marcarComoAlugado<%=rsAnuncios("id")%>');" /> Marcar anúncio como ALUGADO
      </p>
    </div>
  </form>
</div>  
</div>
</td>

And here the javascript:

function alugadoVendido(url, obj1){
    //$(".marcarComoVendidoAlugado").attr("checked", false);
    $(".marcarComoVendidoAlugado").prop("checked", false);
    $("#"+obj1).prop("checked", true);
    window.rotinas.location.href = url;
}
  • You can post your code to JSFIDDLE?

  • What about firebug bugs? - Not releasing anything?

  • Are you using a plugin like "Uniform" or other that mask the checkbox? - This type of plugin causes errors of this type - http://www.jquerycode.com/theming/uniform-js/

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.