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

151
Views
TypeError no detectado: no se pueden leer las propiedades de undefined (leyendo 'objetivo') y (leyendo 'valor')

Después de las actualizaciones de la versión de JQuery a 3.5.0 desde 2.14, recibo el siguiente error, pero no entendí completamente cuál es el problema, hay radio = event.target El error que recibí en la definición de Cannot Read Properties of Undefined ( Leyendo 'objetivo') ¿Alguien puede ayudarme a resolver? *

 var testMethod = { testSubMethod: function (event) { var radio = event.target; var isMultiInput = $('#MultipleInputYes').is(':checked'); if (!isMultiInput || radio.value == undefined) { $('.divMultiInput').addClass("dp-none"); if (radio.value == 'false') { $('#divInputValueType').prop('disabled', false); $('#divInputValueType').attr('style', ''); } } }, }
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" /> <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/js/select2.min.js"></script> <div class="radio radio-success"> <input type="radio" id="MultipleInputYes" value="true" name="IsMultiInput" onchange="testMethod.testSubMethod(this)"> <label for="MultipleInputYes"> Yes</label> </div> <div class="radio radio-success"> <input type="radio" id="MultipleInputNo" value="false" checked="checked" name="IsMultiInput" onchange="testMethod.testSubMethod(this)"> <label for="MultipleInputNo">No</label> </div>

about 4 years ago · Santiago Gelvez
2 answers
Answer question

0

Creo que el event debe estar indefinido en

 var radio = event.target;

de modo que cuando intente acceder a event.target , acceda a la propiedad de target de undefined , que es un error en javascript, intente verificar si el evento está definido primero

 var radio = event ? event.target : undefined
about 4 years ago · Santiago Gelvez Report

0

testMethod.testSubMethod(this) this - referenciado al objeto html en su caso.

Así que probablemente cambiando

 testSubMethod: function (event) { var radio = event.target;

a algo como esto puede solucionar su problema

 testSubMethod: function (el) { var radio = el;
about 4 years ago · Santiago Gelvez 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!