Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6211443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:20:18+00:00 2026-05-24T06:20:18+00:00

I make a call to the function add_reg, but when the new row is

  • 0

I make a call to the function “add_reg”, but when the new row is added the click event don’t work, what can be happening? thanks

function add_reg(){
cant_empleados++; 
if($('#id_zona').val() == 2){
    var nuevo_reg = '<div style="clear:both"></div><div id="empleado_' + cant_empleados + '" class="cont_empleado" onmouseover="this.style.background=\'#F2F2F2\';" onmouseout="this.style.background=\'#FFFFFF\';"><div style="float:left; width:136px; padding-left:15px"><input name="existe_emp' + cant_empleados + '" id="existe_emp' + cant_empleados + '" type="hidden" value="n" /><input name="existe_reg' + cant_empleados + '" id="existe_reg' + cant_empleados + '" type="hidden" value="n" /><input name="cuil' + cant_empleados + '" type="text" id="cuil' + cant_empleados + '" value="" style="width:130px" alt="99-99999999-9" onblur="buscarNombre(this.value, ' + cant_empleados + ');" maxlength="13"   tabindex="' + tab++ + '"/></div><div style="float:left; width:256px"><input name="apellido_y_nombre' + cant_empleados + '" type="text" id="apellido_y_nombre' + cant_empleados + '" style="width:250px"  maxlength="20" tabindex="' + tab++ + '" value=""/></div><div style="float:left; width:106px"><input name="categoria' + cant_empleados + '" type="text" id="categoria' + cant_empleados + '" value="" style="width:100px"  maxlength="7" tabindex="' + tab++ + '"/></div><div style="float:left; width:96px"><input name="retribucion_mensual' + cant_empleados + '" type="text" id="retribucion_mensual' + cant_empleados + '" alt="decimal" style="width:90px" onblur="calcular_porcentaje(' + cant_empleados + ');"  tabindex="' + tab++ + '" value="" /></div><div style="float:left; width:auto"><input name="cotizacion_sindical' + cant_empleados + '" type="text" id="cotizacion_sindical' + cant_empleados + '" alt="decimal"  value="" style="width:80px; background-color:#F1F1F1" readonly="readonly" />&nbsp;</div><div style="float:left; width:auto">  <input type="checkbox" name="imputar_sss' + cant_empleados + '" id="imputar_sss' + cant_empleados + '" value="' + cant_empleados + '"  checked="checked" /> <input name="sistema_social_solidario' + cant_empleados + '" type="text" id="sistema_social_solidario' + cant_empleados + '" alt="decimal"  value="" style="width:55px; background-color:#F1F1F1" readonly="readonly" />&nbsp;</div><div style="float:left; width:auto">  <input type="checkbox" name="imputar_rpp' + cant_empleados + '" id="imputar_rpp' + cant_empleados + '" value="' + cant_empleados + '" checked="checked" /> <input name="prestaciones_previsionales' + cant_empleados + '" type="text" id="prestaciones_previsionales' + cant_empleados + '" alt="decimal"  value="" style="width:55px; background-color:#F1F1F1" readonly="readonly" />&nbsp;</div><div style="float:left; width:auto">  <a href="javascript:borrar_reg(' + cant_empleados + ')" title="Borrar registro" onclick="return confirm(\'¿Esta seguro de querer borrar este registro?\');"><img src="./images/ic_borrar.gif" alt="Borrar" /></a></div></div>';
}else{
    var nuevo_reg = '<div style="clear:both"></div><div id="empleado_' + cant_empleados + '" class="cont_empleado" onmouseover="this.style.background=\'#F2F2F2\';" onmouseout="this.style.background=\'#FFFFFF\';"><div style="float:left; width:136px; padding-left:15px"><input name="existe_emp' + cant_empleados + '" id="existe_emp' + cant_empleados + '" type="hidden" value="n" /><input name="existe_reg' + cant_empleados + '" id="existe_reg' + cant_empleados + '" type="hidden" value="n" /><input name="cuil' + cant_empleados + '" type="text" id="cuil' + cant_empleados + '" value="" style="width:130px" alt="99-99999999-9" onblur="buscarNombre(this.value, ' + cant_empleados + ');" maxlength="13"   tabindex="' + tab++ + '"/></div><div style="float:left; width:256px"><input name="apellido_y_nombre' + cant_empleados + '" type="text" id="apellido_y_nombre' + cant_empleados + '" style="width:250px"  maxlength="20" tabindex="' + tab++ + '" value=""/></div><div style="float:left; width:106px"><input name="categoria' + cant_empleados + '" type="text" id="categoria' + cant_empleados + '" value="" style="width:100px"  maxlength="7" tabindex="' + tab++ + '"/></div><div style="float:left; width:96px"><input name="retribucion_mensual' + cant_empleados + '" type="text" id="retribucion_mensual' + cant_empleados + '" alt="decimal" style="width:90px" onblur="calcular_porcentaje(' + cant_empleados + ');"  tabindex="' + tab++ + '" value="" /></div><div style="float:left; width:auto"><input name="cotizacion_sindical' + cant_empleados + '" type="text" id="cotizacion_sindical' + cant_empleados + '" alt="decimal"  value="" style="width:80px; background-color:#F1F1F1" readonly="readonly" />&nbsp;</div><div style="float:left; width:auto"> <input name="sistema_social_solidario' + cant_empleados + '" type="text" id="sistema_social_solidario' + cant_empleados + '" alt="decimal"  value="" style="width:80px; background-color:#F1F1F1" readonly="readonly" />&nbsp;</div><div style="float:left; width:auto"> <input name="prestaciones_previsionales' + cant_empleados + '" type="text" id="prestaciones_previsionales' + cant_empleados + '" alt="decimal"  value="" style="width:80px; background-color:#F1F1F1" readonly="readonly" />&nbsp;</div><div style="float:left; width:auto">  <a href="javascript:borrar_reg(' + cant_empleados + ')" title="Borrar registro" onclick="return confirm(\'¿Esta seguro de querer borrar este registro?\');"><img src="./images/ic_borrar.gif" alt="Borrar" /></a></div></div>';
}
$("#totales").before(nuevo_reg);
$("#empleado_" + cant_empleados).hide();
$("#empleado_" + cant_empleados).fadeIn();
$("#cant_empleados").val(cant_empleados);
$("#cuil" + cant_empleados).setMask();
$("#retribucion_mensual" + cant_empleados).setMask();

try{
    setActionImputar('#imputar_sss' + cant_empleados);
    setActionImputar('#imputar_rpp' + cant_empleados);
}catch(e){
    //  no hago nada
}}

function setActionImputar(selector){
$(selector).click(function(){
    calcular_porcentaje($(this).val());
});}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:20:20+00:00Added an answer on May 24, 2026 at 6:20 am

    You should use the live bind

    function setActionImputar(selector){
    $(selector).live('click', function(){
        calcular_porcentaje($(this).val());
    }); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way I can make Firefox call a JavaScript function in my
I want to make a link call a Javascript function through the onclick event
How can I call a function and keep my constructor private? If I make
Can I make ComboBox from AjaxToolkit make call to server every time new letter
I'd like to make a call to a function and send either a string
GCC seem to think that I am trying to make a function call in
I often want to make a multiline function call and reduce it down to
trying to make a page which will recursively call a function until a limit
I am using the $.ajax function in jquery to make a call to an
How to call or make the javascript function from the Application_Start of global.asax in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.