• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Date comparision

 
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I use the above code to check whether the date selected by user is current date and not the future dates. That is date is equal to current date or past date and not future date. But this code(i just want to print them both) seems to be not working.. Please help me ranchers...
[ August 27, 2008: Message edited by: Bear Bibeault ]
 
author & internet detective
Posts: 42056
926
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rajkumar balakrishnan:
But this code(i just want to print them both) seems to be not working.. Please help me ranchers...


Please explain how it is "not working". Does it give you a JavaScript error. Does it give you the wrong output? Does it make the browser crash? What's wrong?
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeanne Boyarsky:

Please explain how it is "not working". Does it give you a JavaScript error. Does it give you the wrong output? Does it make the browser crash? What's wrong?



I call the function in onFocus event of a textfield but when i focus on the textfield nothing happen... No alert box was displayed. This is my problem?
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Start by putting a simple alert at the top of your function, make sure that it _is_ being called.
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Martijn Verburg:
Start by putting a simple alert at the top of your function, make sure that it _is_ being called.



Yep... i do that and the alert box called perfectly and after the if loop only it skips...
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


And i call this here...

<input type="text" name="serialnumber" value="${modelBean.serialnumber}" onFocus="datevalidate()"/>



But there is no response from the script... It doesn't show any alert box and i struggle to know the fact.Please help me ranchers to fix this problem....
 
Martijn Verburg
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, next hint

Run the code through a debugger, the Firebug tool that comes as a plug-in for Firefox is excellent, you can also use Eclipse or many other javascript debugging tools

If you can't get a debugging tool to work, I suggest you put an alert statement outputing the result of each line of code in in your function



I think you'll narrow your problem down from there
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Martijn Verburg:
OK, next hint

Run the code through a debugger, the Firebug tool that comes as a plug-in for Firefox is excellent, you can also use Eclipse or many other javascript debugging tools

If you can't get a debugging tool to work, I suggest you put an alert statement outputing the result of each line of code in in your function



I think you'll narrow your problem down from there


Watch my previous post. I have changed my javascript code(and sorry for not mention that)... Thats a very simple code and even that too not working....
 
Martijn Verburg
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rajkumar balakrishnan:

Watch my previous post. I have changed my javascript code(and sorry for not mention that)... Thats a very simple code and even that too not working....



I still suggest doing the same thing, run your code through the debugger or add an alert statement between each line in your function, you'll narrow down where you when wrong
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Martijn Verburg:


I still suggest doing the same thing, run your code through the debugger or add an alert statement between each line in your function, you'll narrow down where you when wrong



Sure... i am downloading FireBug and sure post the error here....
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Martijn Verburg:


I still suggest doing the same thing, run your code through the debugger or add an alert statement between each line in your function, you'll narrow down where you when wrong



FireBug shows just green symbol and no indication of error....
 
Martijn Verburg
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, try putting an alert statement in between each line of code in your function, see when it stops processing the alerts.
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Martijn Verburg:
OK, try putting an alert statement in between each line of code in your function, see when it stops processing the alerts.



It just stop working at the var val2=document.write(year + "/" + month + "/" + date) line and i dont know whats wrong with this code.. Here is my full code

Please let me know whats wrong there..... Help me ranchers..
 
Martijn Verburg
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rajkumar balakrishnan:


It just stop working at the var val2=document.write(year + "/" + month + "/" + date) line and i dont know whats wrong with this code.. Here is my full code

Please let me know whats wrong there..... Help me ranchers..



OK, that's good work! You've discovered the line that is causing you problems . Now, have a read of what document.write actually does and what it returns.... You're almost there!
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yep.... i got it and the problem is with the date formats ... I fix it and now it works perfect....Thanks for all ranchers... who spend their time with me......
 
Martijn Verburg
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great! Glad to see you solved your problem, well done
 
When I was younger I felt like a man trapped inside a woman’s body. Then I was born. My twin is a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic