Solved

Required fields in edit form not allowing to submit the form

Posted on 2012-03-27
4
765 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I have just recently built a new SharePoint 2007 farm on a complete Windows 2008 R2 server platform and part of my standard build procedure is to implement a warm up routine, usually in the form of a script that is scheduled every morning to launch …
When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010genera…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now