I tried googling, but there was nothing readily available for SharePoint. The next thing came to my mind was using a Javascript snippet, but how do I add the snippet to the code was another challenge. Please read through the article below to understand how to go about this.
1. First task was to create a list for the customer which had "Order Date" and "Processed Date"
2. Once this is created I need to write a Javascript snippet which will make sure the Processed Date is in between "Order Date" and todays date(current date)
so here is it:
3. Now that the snippet is ready I need to find a way to include this to the "NewForm.aspx" and also to "EditForm.aspx", Initially I though of using SharePoint Designer to do this, but somehow though there could be an easier way. Finally after 3 days and sevral cups of tea I found that I can add a content editor webpart the "NewForm.aspx" and "Editform.aspx" page . Normally "Edit Page" option is grayed out for these pages. But there is a cheat to get in
Just append "ToolPaneView=2" to the end of the URL for example
http://servername/site/sitename/lists/OrdProc/NewForm.aspx?ToolPaneView=2
4.Next step is to add a contet editor webpart to the bottom of the page and copy the javascript snippet to the source editor. Click on Save and Apply ok on the webpart properties menu. Thats it its done!!.
6. The second thing I need to test what happens if I choose a date later that todays date.
and as you can see in the above pictures, it worked!! . You can also use the same two validate date between two differrent dates other than today, just tweak the javascript.
3 comments:
Genial fill someone in on and this post helped me alot in my college assignement. Say thank you you as your information.
can u send the javascript code
http://linguinauts.com/node/46149
Post a Comment