Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert row table 1

Status
Not open for further replies.

anvikon

Technical User
Jun 21, 2010
2
US
hi,

I am working on inserting row on table grid using javascript .

I have a done like below.



oCell.innerHTML = "<input type='text' name='DateTime' id='DateTime' size='18' class='maincontent1'>
<a href=javascript:NewCssCal('DateTime','yyyymmdd','arrow',true,24,false);><img src='images/cal.gif' width='16' height='16' border='0'alt='Pick a date'> </a> ";
oCell = newRow.insertCell();

Is this correct way?

Using this , when I insert another row on the table the calender is pointing to the same text box as previous. what is another way to point the next testbox.


Can anyone anwer my question please?
 
[tt] var sid_name='DateTime'; //just prepare it to be varying

oCell.innerHTML = "<input type='text' name='[blue]"+sid_name+"[/blue]' id='[blue]"+sid_name+"[/blue]' size='18' class='maincontent1'><a [red]onclick='NewCssCal(this.parentNode.getElementsByTagName(\"input\")[0].id,\"yyyymmdd\",\"arrow\",true,24,false);' href='#'[/red]><img src='images/cal.gif' width='16' height='16' border='0'alt='Pick a date'></a>";[/tt]

ps: no line break before <a ...> if that is not an artifact in your post.
 
thanks for your reply.

But still the cursor control is focusing to the previous textbox.

I want to show the datepicker on each row of the table.
 
That's all I can do with the id/name structure deduced from the post to be feed to the NewCssCal(). There is no guarantee the function is correct. I cannot of further help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top