File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use setTimeout function

 
pravin rasal
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have following code




I want to set the value in the text field "text4" by decrementing "no" variable by some second but it didn't working please help me
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"didn't work" is not helpful. What did happen? Please show us the complete code and what you tried to do.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First problem is $("#text4").val(i) is being executed right away. You need to use a closure/anonymous function.

Eric


 
pravin rasal
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to display value in text field some interval
 
pravin rasal
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JavaScript I have following code:


If I have no =4000 then I want to display that number in textfield(i.e text4) but after some interval means 4000 -'500ms'-3999-'500ms'-3998-'500ms'...........to -'500ms'-0.
 
pravin rasal
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my problem solved
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic