Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

95
Views
Predeterminado seleccionar primer botón de radio
 <div id="ManageAddressPage" runat="server"> <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <div id="EditAddressPage" style="border: solid 1px LightGray;background-color:#f5faff"> <div style="padding:15px"> <asp:Label ID="lblAddressID" runat="server" Text='<%# Eval("AddressID") %>' Visible = "false" /> <asp:RadioButton ID="RadioButton" runat="server" Onclick="javascript:singleselection(this.id)" ></asp:RadioButton> <asp:Label ID="lblContactName" style="margin-right:15px" runat="server" Text='<%# Eval("Name") %>' /> <asp:Label ID="lblCountry" runat="server" Text='<%# Eval("PhoneNumber") %>' /> </div> <div style="margin-left:10px;width:90%;margin-bottom:20px;"> <asp:Label ID="lbladdress" runat="server" Text='<%# Eval("Address") %>' /> </div> </div> </ItemTemplate> </asp:Repeater> </div> <script type="text/javascript" > function singleselection(rbid) { var rbutton = document.getElementById(rbid); var rbuttonlist = document.getElementsByTagName("input") for (i = 0; i < rbuttonlist.length; i++) { if (rbuttonlist[i].type == "radio" && rbuttonlist[i].id !== rbutton.id) { rbuttonlist[i].checked = false; } } } </script>

Si el código anterior no ejecuta ninguno de los botones de radio seleccionados, si el usuario hace clic, entonces está seleccionando, pero quiero seleccionar de forma predeterminada la primera opción y luego, si el usuario selecciona cualquier opción, seleccione solo esa opción, esta página es como seleccionar la dirección. Por favor, alguien ayuda en esto.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Esto se debe a que no está activando el clic en la carga de su página. Prueba esto :-

 document.getElementById("RadioButton").click();
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!