Thursday 4 October 2012

Sharepoint Form Validation using Javascript


Sharepoint Form Validation using Javascript

1.First open the Newform.aspx which you want to validate.(go to list and go to "New item" page)
2.then add ?PageView=Shared&ToolPaneView=2 part at the end of the urlEx: http://mysite/Lists/job/NewForm.aspx
http://mysite/Lists/job/NewForm.aspx?PageView=Shared&ToolPaneView=2
3. Add "Content editor web part " and modify this web part with source editor option
4. Add following javascript which use to validate start date & due date

5. Now use it...
6. If you want to use javascript to validate other field just put following script and modify it as you wish.. 

<Script language="javascript">
function PreSaveAction()
{
//add your JavaScript code here and return true / false
}
</Script>

No comments:

Post a Comment