aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes insertrow calender Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "insertrow calender" Watch "insertrow calender" New topic
Author

insertrow calender

anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
hi,

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

I have a done like below.




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?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Give them unique ids/names.

Eric
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
Can you give some example please?

I have done like below, I got javascript error.





Is this correct way?

Can anyone correct me please?

thanks













Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
"this" is not want you want. This points to the link that you are clicking. You need to make a unique id for the textbox so you can reference it as I already stated. It is not hard, create a counter. Each time you add one, increase the counter. Add that to the textbox's id.

Eric
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
thanks for you reply.


I did something like below as you said. I didn't get the excepted results.

var id = 'Datetime';
var count =0;



in the above code, where should I add the count?

Can you please correct me, If I am wrong ?

thanks



Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
why look up the id when you already have it? Just hardcode the string into the link tag's onclick.

Eric
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
Do you mean here ?

Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6



Eric
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
thanks,

where should I add the count part?

Still the cursor control focus to the previous textbox.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
id should be built with the counter.

id = "someString" + count

Eric
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
Thanks for your help.

It worked.
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
If I give the unique Id in the jsp page and js, the cursor still pointing to only prev textbox.


Here is the detail code:

the below is the html code




For the above code I need to add a date picker for next row.


I did like below.





With the above code the cursor control pointing to the previous.






Do you have any solution for this? Please let me know


thanks
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
For the same code, whenever I insert second row, the datepicker doesn't addup to the array.


Here is the code:

for example:


DateTime still shows string[1] even if we have two rows.

what is the soultion for this?

thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: insertrow calender