You need to sign in to do that
Don't have an account?

Save and continue button
I have a pretty large visualforce page that I am having people fill out. I have set about 50 fields on it to be required like <apex:inputfield required="true" value="{!var1}"> I want the field to be required so that before they can finish the page they need to fill that field out. I would also like to give them a "Save and Continue" button so that they can save their progress. I want this button to bypass the required flag but it needs to pass the variable var1 to the method so that it saves it. Then I want a second save button that enforces the required flag. Is there anyway to do this?
You can use the immedieate attribute on a CommandButton to bypass validation so that it won't validate it.
Save would have immediate="false".
Save and Continue would have immediate="true".
http://blogs.developerforce.com/developer-relations/2008/12/using-the-immediate-attribute-on-commandlinks-and-commandbuttons.html
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_commandButton.htm
This may be an idea from left field, but it might work just the way you need it. Validation rules (rather than layout required fields) can be conditional. If you have a hidden field of "skip validation" or something like that, and have the save and continue button check that with the onclick method, then your validation rules can validate only when it's not checked (meaning the user used the save button).
I think you are right ScriptMonkey that I could do it with validation rules. What I ended up doing was using this http://boards.developerforce.com/t5/Visualforce-Development/How-to-add-error-message-to-specific-inputText-inputfield/m-p/198455#M26840 to add custom error messages and then just built in a check for every field to make sure it was not null or ''. thanks for the ideas.