Tag Info

Hot answers tagged

11

A simple solution is to just validate the fields on submit by adding a validation rule in the list settings. Go to List Settings Open Validation settings under the General Settings area In the formula add your formula, I think it will be like this in your scenario: ...


8

I hope this can help you, althought I have not tested it. You can find an example here: http://www.sharepoint-tips.com/2010/06/validating-web-part-properties.html private string _webPartContentLink = null; [Personalizable(PersonalizationScope.Shared)] [WebBrowsable(true)] [System.ComponentModel.Category("Services")] ...


5

Couple of questions: What column data type are you using? What column validation formula are you using? Just to be sure, are you using the OOTB column validation feature and not some custom validation feature? If so, did you specify the user message property? I am able to create a simple number column, and set a validation formula as follows And, when ...


3

I don't know what your markup is but here's a formula for list validation in SharePoint 2010 that should do what you need. Just add this to the list for your validation (and adjust the field names accordingly). =IF(NOT(ISBLANK([End Date])),[End Date]>[Start Date],TRUE) This will only validate the end date to be greater than the start date when you have ...


3

Only reasonable solution for using javascript on InfoPath form would be to create custom page, host InfoPath in webpart and add javascript directly to page. Main issue here is that InfoPath controls ID's are dinamically generated so it is challenge to 'find them' with javascript. A while back I developed one simple solution by using jQuery (and again it was ...


3

Batman, This should help: How to Validate a Due Date in a SharePoint 2010 List In short use Column Validations in Column Settings, a short formula can be: [Due Date] > Today()


3

change your code to: <Taxonomy:TaxonomyWebTaggingControl runat="server" ID="taxProjectOwnerDepartment" Visible="true" IsMulti="false" IsDisplayPickerButton="true"> </Taxonomy:TaxonomyWebTaggingControl> <asp:CustomValidator ID="rfvProjectOwnerDepartment" runat="server" OnServerValidate="validator_ServerValidate" /> now in your ...


3

At least two options are available when it comes to client side validation in SharePoint 2013: Client-Side Rendering (CSR) Validation Override Save handler using PreSaveAction function Assume the scenario where we need to add client side validation for Email column in the Contacts list. Client-Side Rendering (CSR) Validation in SharePoint 2013 CSR is ...


2

This codeplex project allows you to add regular expression validation to fields Codeplex - SharePoint Custom Field Type - Regular Expressions Be very careful trying to validate email addresses using RegEx though (either through this tool or javascript) - its seems like a ideal candidate for regex until you get into the details and there are a lot of ...


2

Other methods you can use: Create a validation formula in the List Settings / Validation Settings. Add some script to your forms to validate on the blur event or in the PreSaveAction I prefer using script on the blur event because I can give immediate feedback to the user, as they are used to on other modern Web sites.


2

It's an age old issue with SharePoint that apparently hasn't been resolved in 2010: you cannot reference a lookup column in a calculated column. EndUserSharePoint.com did a lengthy series on calculated columnns. Another suggestion I've seen is to do the calculation on the client side using JavaScript: http://www.graphicalwonder.com/?p=252. I understand ...


2

Looks like regex is not exported in the new column validation feature. References: http://www.sharepointdevwiki.com/display/sp2010/Site+Column+Validation Laura Rogers blogged about a way to pull it off in a Data View Web Part: http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?ID=83


2

Try the formular: =OR([Class date]>=TODAY()+3,Created<TODAY()) Where the first formular could be specified as validation on the column, this needs to be at the list level:


2

I figure this out, the problem was, I was testing with empty values, more exactlly I was left TextBox blank, and click on Submit button. But neither CustomValidator nor InputFormCustomValidator don't work with Empty values, unless ValidateEmptyText property is set to true. So all I was needed is to set ValidateEmptyText property to true. Now it works as ...


2

In list settings you can only set, that field is either required or not. To do some more advanced logic, you probably would need to create Custom Field, and write your own validation based on values from another field. Use of Event Receivers is of course another way.


2

An event Receiver would indeed a possible solution here.You'd then override the ItemAdding event checking the Checkbox field value if yes and textbox is empty then cancle event firing and return false. Something like this: properties.Cancel = true; properties.ErrorMessage = "Item Must Required"; properties.Status = ...


2

In addition to what Wictor said, remember to define your own ValidationGroup when you are using custom or out of the box ASP.NET validators, that way you dont get interference from other validation controls that might be on the same page when you do a post back (maybe a subject for your book Wictor?:-)


2

You will need to do it in code behind in the InfoPath form. Here is a link to that. You can still use you C# code to do it. Take a look below. http://www.bizsupportonline.net/infopath2007/infopath-basics-3-ways-validate-data-infopath.htm


2

If it is SharePoint List form, you can simply make the fields as Required and SharePoint will handle it... But if its some other form, which I think it is... you can use JavaScript like this: <script type="text/javascript"> function onSubmitValidation() { if (TrimAll(document.getElementById("field1").value) == "") { alert('All fields are ...


2

You can register form submit code using Page.ClientScript.RegisterOnSubmitStatement method. There you can make JS validation and prevent submission of the form. Please check my blog post for more info.


2

At least one can be selected: =OR([checkbox1],[checkbox2]) Both must be selected: =AND([checkbox1],[checkbox2]) Only one can be selected: =AND(OR([checkbox1],[checkbox2]),NOT(AND([checkbox1],[checkbox2])))


2

Sharepoint 2007 and earlier are not (AFAIK) validate-able. Sharepoint 2010 and up are (AFAIK). However! This will require that your systems are Part 11 compliant. Being Part 11 compliant means not needing hard copies of everything for regulations. It's pretty costly to validate your system, since you have to take lots of measures to prevent false data being ...


2

You can't trigger the form validation through javascript, however you can do something else. In both the New form and the Edit form the Save button has onclick which triggers PreSaveItem() which is a function in FORMS.js that invokes a function called PreSaveAction which is a user defined function, meaning it is a function you define and decide what should ...


1

Carel, You should add a Validation Summary kind of a View/Box where you put all the labels and apply Rules for them to show/hide! Following screenshot will help you what I am trying to say: Or if the validations are complex and not be done by Rules, then you have to go for writing code: Validation summary in InfoPath 2010


1

One solution is a workflow that fires when they add a new item, the other is an Event Handler that fires when they add a new item. Workflows can be built using SharePoint Designer and don't necessarily require programming experience; while Event Handlers are built using Visual Studio and requires quite a bit of programming experience. I know this isn't a ...


1

It has nothing to do with visual webparts <=> standard web parts. It's purely a sandbox problem. Thowing exceptions out of sandboxed code isn't supported and will be caught by the sandbox and cost you points. The code above works great if you just change your solution to being a farm solution, but if you want it in a sandbox you have to move the check ...


1

In my case I wanted to validate a 4 to 5 field Identifier named IS. The IS field should contain 4 to 5 Upper case letters. I did it using ASCII code. Sum must return a value of 12. lower case letters sum less than 12, in that case sentence returns false: ...


1

For Custom Error Message you use this Code.. <sharepoint:datetimecontrol id="dteDemo" runat="server" dateonly="true" /> <asp:CompareValidator ID="valDate" runat="server" ForeColor="Red" ControlToValidate="dteDemo$dteDemoDate" Type="Date" Operator="DataTypeCheck" ErrorMessage="*"> </asp:CompareValidator>


1

What you may be able to do is when the status is changed to processing put an action rule that makes a label visable next to the EntryDate field that indicates to populate. Then if you have a submit button, add an action rule on this that double checks the fields in question to make sure they are as they should be: If status is Processing EntryDate should ...


1

You can use the sharepoint's column validator. Check this blog: http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-an-email-address-using-column-validation-in-sharepoint-2010/



Only top voted, non community-wiki answers of a minimum length are eligible