C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Detect Weekend in JavaScript and Confirm


Posted Date: 28 Apr 2007    Resource Type: Code Snippets    Category: Validations

Posted By: Vasudevan Deepak Kumar       Member Level: Diamond
Rating:     Points: 10



This script sample shows how to detect week ends (Saturyda and Sunday) using Javascript.

The Necessity:

In most of the enterprise applications servicing the customer requests like eShopping websites, there need to be quick validation to ensure that customer orders that are recieved on Friday evening are suitably informed to the customer that delivery will happen only during serviceable business days.

Most of the enterprise applications hide this clause under Fine Prints and Terms and Conditions. The customer assumes normal deliveries across the weekends. When it gets delayed there is a fight between them and hence bad customer relationships. We can avoid all by a simple form validation before the customer finally submits the order to the store.

Solution Description: The solution epicenters around JavaScript getDay() function which returns 1 for Sunday, 2 for Monday and so on and so forth. We assume that the enterprise does not ship orders on Saturdays and Sundays (Happy Weekends. :) ) And hence when the customer attempts for delivery requests on these days, a warning message will be given to the user.














Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Skip validation for calculated values displayed in a textbox
Previous Resource: Javascrip for Select All Checkbox
Return to Discussion Resource Index
Post New Resource
Category: Validations


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

fax server

Contact Us    Privacy Policy    Terms Of Use