tags:

views:

27

answers:

0

Hi,

I have one scenario I need to create one text box row dynamically with date picker.The text box name should be same while creating new row. Whenever I am doing this I am get into trouble . I could not execute and get the result.Without date picker I can able to create new row with multi text boxes. when I am adding text box, it is not working. Any one can help me to resolve this issue. I am investigate over this issue since last week.

Here the code what i am using to create new row with date picker (dynamically).

if(x == "Since Timestamp" )
{       
var addRow = $(this).parent().parent();
var  newRow = $(this).parent().parent().clone(true);                    
if($(this).parent().parent().prev().attr('id') != null)
var myInput = $('<input type="text" id="days"  name="days" />');
$(myInput).datepicker();
$('td:eq(0)', newRow).html('<select name="cond3" id="cond3" class="dnr" disabled="true"><option>And</option><option>Or</option></select>'); 
$('td:eq(2)',newRow).html($(myInput));
$('td:eq(3)', newRow).html('<input type="text" name="datetime" id="datetime"   style="width:60px">'); //.append('HH:MM');
$('td:eq(3)', newRow).attr('style','width:120px');
newRow.find("select").val(x);   
$('select',newRow).each(function()
{            
      if( this.id == 'cond3' )
      {
       $(this).val(selectedval);                        
      }
});                     
$(this).parent().parent().after(newRow);
$(this).parent().parent().remove();
return true;                        
}               

Thanks in advance buddy...