Solved

Required fields in edit form not allowing to submit the form

Posted on 2012-03-27
4
795 Views
Last Modified: 2012-06-21
I have a new form and edit form for one of the SP list.

In the new form there are only around 5 fields, however, in the edit form there are around 20 fields.

Now here is my problem, some of the fields in 'Edit form' are required fields. However, since they are required, when I tried to submit the form using 'New form' which doesn't contain those fields, I get errors stating that I can't submit forms because I don't have any values in those required fields.

I tried couple workarounds but couldn't get away with it. Has anyone solved this issue yet?

I would really appreciate all the suggestions and comments.
0
Comment
Question by:KoolAsIce
  • 2
4 Comments
 
LVL 18

Expert Comment

by:ivan_vagunin
ID: 37775213
Hi!
How do you hide these required fields on a new form? Do you have a custom forms? Which controls do you use to render fields?
Usually if a new form does not SharePoint:FormField controls for required field, then you can submit these form without any problem, because validators are inside these formfield controls.
0
 
LVL 5

Expert Comment

by:Robin Hall
ID: 37779115
KoolasIce,

The way that I have gotten around this issue, when using an InfoPath form submitting to a SharePoint list, is to rely on InfoPath, not SharePoint, to be in charge of making a field "required".  I deselect the "Required" option for the field in SharePoint and use InfoPath's Validation rules to make it happen.  I accomplish this by using conditional validation rules.

For example, I have 5 fields on view "New Form" and 10 fields on "Edit Form".  The "Status" field (the one I need to be required) only shows up on the "Edit Form".  In order to make it required I set up a Validation rule on the "Status" field.  The rule is if "Due Date" (also only found on the "Edit Form") is not blank, then the field is "Required".  I know "Due Date" will always be filled out by my staff which is why I use this field.

When Person X fills out the "New Form", the required field is turned off because "Due Date" is blank.  When Person Y fills out the "Edit Form", the required field gets turned on because he fills in 4/3/2012 for "Due Date" which makes the "Status" field required.  If Person Y tries to fill out the form without putting something in "Status", he will receive an error message and get shown a red asterix on what he needs to fix.

This way is useful, but only if you have a field that you know a user will always fill out.  It won't work as will if filling out the conditional field is not a mandatory step of the "Edit Form" view.  There are a lot of options under the 'conditions' for the validation rule so there are probably several way that you could set up a required field depending on how your form is created.
0
 

Accepted Solution

by:
KoolAsIce earned 0 total points
ID: 37779406
Here is the better solution that I have found:

Instead of using 'Submit' button of the ribbon, disable that submit button and create your custom submit button.

Now one can easily setup a rule for that button to be grayed out until all the required fields are filled so user cannot submit until he/she fill all the required fields. This workaround worked great for me!
0
 

Author Closing Comment

by:KoolAsIce
ID: 37795192
I have found the better solution in the mean time!
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question