Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 4th, 2007, 03:26 AM
Authorized User
 
Join Date: Jul 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default date time validation

Hello sir,

How to Validate MM/DD/YYYY HH:MM:SS AM this format date value in javascript. I want to validate in cliend side. PLease help me

Ok Thankyou

 
Old December 4th, 2007, 04:50 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can use Calendar object in java script.
Use the resources available at the following links

http://www.bigwebmaster.com/JavaScri...ams/Calendars/
http://www.merlyn.demon.co.uk/js-dates.htm
http://www.weberdev.com/get_example-353.html


- Rakesh
 
Old December 4th, 2007, 05:38 AM
jomet
Guest
 
Posts: n/a
Default

If you have a "Today's Date" field in your form, u can use JavaScript for fill it for your visitors

something like this...

<form name="dform">
<input type="text" name="currentdate" size=11>
</form>


<script>

/*Current date in form credit:
JavaScript Kit (www.javascriptkit.com)
Over 200+ free scripts here!
*/

var mydate=new Date()
var theyear=mydate.getYear()
if (theyear < 1000)
theyear+=1900
var theday=mydate.getDay()
var themonth=mydate.getMonth()+1
if (themonth<10)
themonth="0"+themonth
var theday=mydate.getDate()
if (theday<10)
theday="0"+theday

//////EDIT below three variable to customize the format of the date/////

var displayfirst=themonth
var displaysecond=theday
var displaythird=theyear

////////////////////////////////////

document.dform.currentdate.value=displayfirst+"/"+displaysecond+"/"+displaythird
</script>

:)

jomet.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting Time from Date/Time Navy1991_1 XSLT 2 June 3rd, 2008 12:03 PM
date and time in EST time zone anboss XSLT 1 May 21st, 2008 01:42 PM
Validation at Run Time nicesukhi Visual Studio 2005 0 July 20th, 2006 02:43 AM
comparing date/time fields on form validation Lucy Javascript How-To 1 June 20th, 2006 09:22 AM
insert system date. no date and time jimmy Access VBA 6 November 20th, 2003 01:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.