Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsRequired #52

Open
Gabreezy03 opened this issue Nov 1, 2017 · 4 comments
Open

IsRequired #52

Gabreezy03 opened this issue Nov 1, 2017 · 4 comments

Comments

@Gabreezy03
Copy link

Can anyone please assist me on how IsRequired is implemented because it doesn't seem to work on my side.

@Gabreezy03
Copy link
Author

@kitmenke Can you please assist?

@kitmenke
Copy link
Owner

kitmenke commented Nov 4, 2017

Hey @Gabreezy03,
IsRequired is implemented here: https://github.com/kitmenke/sputility/blob/master/src/sputility.js#L222

Generally a field is displayed in SharePoint like this:

<nobr>Title<span class="ms-formvalidation" title="This is a required field." > *</span></nobr>

So for each field, IsRequired is set to true when the asterisk (*) is present and false when it is missing. Hope this helps.

@Gabreezy03
Copy link
Author

@kitmenke thank you for your quick response. I would like to make certain fields required based on a condition.

@kitmenke
Copy link
Owner

kitmenke commented Nov 6, 2017

As noted in the README, I no longer have time to maintain SPUtility.js but I'll try to help you out.

The IsRequired property only tells you what you've configured in the List Settings.

If you want some fields to be required based on custom logic, SPUtility.js can help but you will need to write some code. Try googling "sharepoint presaveaction".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants