Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

auto-increment no.(sequential no.) in javascript?

 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to create a auto-increment no. through javascript?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You add one to it?

What is your real question here? You are missing some details on why you are asking this.

Eric
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's an auto-incrementing value, anyway? Nothing happens by magic.

Except alpacacorns, the unique hybrid offspring of unicorns and alpacas.
 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's an auto-incrementing value, anyway? Nothing happens by magic.


I have a dhtml grid with a button(add row) below to it. on click of add row button , there is column, on that column the count should come in a sequential order.
i tried by using javascript but got stucked in an endless loop like:-


Iam trying to put the value of 'i' on that column. I know i have not given any 'conditional' in the for loop thats i got endless loop.

is there any other way to do that ? or does dhtml provides some other way to do that like count of row Index, etc like that?

thanks in advance
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you know how many rows you're starting off with, and you know that each time you click to add a row you need to increment a counter--I guess I'm not sure what the problem actually is.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you need a for loop to increment a variable each time a button is clicked?



Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic