I need to save my InfoPath form regardless of whether the required fields have been entered when the user clicks on a button. Is there a way to turn off validation for the InfoPath form temporarily?
By save i assume that you mean that you want to save the xml data file locally rather than submit your form to a datastore (webservice, sharepoint etc)
In tools>form options you can enable "save/save as" on the form (i think this is on by default) it will complain that there are validation errors but still allow you to save.
There is also save via code-behind using which will not go through the validation routine but will require that the form is fully trusted as it needs access resources that Infopath forms are normally restriced from using.
VB.Net
Me.SaveAs("c:\temp\myfile.xml")
C#
this.SaveAs("c:\temp\myfile.xml");
Or as Chris suggested allow nulls as part of your data source.