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")] ...


6

In the Column Validation settings (Edit the Column and it is an expandable section near the bottom) you can use this formula: =ISNUMBER([My Column]+0) Just Replace My Column with your actual Column's name


5

you could create a custom EditorPart which creates a custom interface in which you verify the input. Check this out: Web Part Properties - part 2 - Editor Parts


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 ...


4

When you create an item, the creation date is not set so it can't be used in condition. You can use the current date to do what you want, or a combinaison of the current date and creation date to cover both creation and edit.


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

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 ...


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

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:


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 ...


3

I've never seen a plugin however; its not too difficult to do this on your own. There is a JavaScript function in SharePoint called "PreSaveAction" that is fired just before the item is validated and saved. You can use this function to call your function. For example: function PreSaveAction(){ var itemTitle = $("input[title='GUID']").val(); if ...


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

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

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

Do you use branding on the site ? The validation error elements could be affected by custom styles. Search through the source of your page using developer tools or firebug and see if the message is there.


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 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

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

It's almost the same: $Mywebapplication = Get-SPWebApplication $WebApplication.url $Mywebapplication.FormDigestSettings.Enabled = $false


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

Are you wrapping the column names in square brackets? =TEXT([Column2]-[Column1],"h:mm:ss") Reference: http://msdn.microsoft.com/en-us/library/bb862071(v=office.14).aspx


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

your code is fine appart from one part, you looping on the validation! you need to set date type at the end: so you have: ControlToValidate="dtcProjectPlannedEndDate$dtcProjectPlannedEndDate" should be: ControlToValidate="dtcProjectPlannedEndDate$dtcProjectPlannedEndDateDate" i got that from the error you shown: Unable to find control id ...


2

Please use this =AND(ISNUMBER(myNum+0),MOD(myNum,10)=0)



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