Solved

Required fields in edit form not allowing to submit the form

Posted on 2012-03-27
4
802 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Last week I faced a strange issue recently, i have deployed SharePoint 2003 servers for one project and one of the requirements was to open SharePoint site from same server. when i was trying to open site from the same server i was getting authentic…
If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

696 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