Sign up ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a data view web part and it does insert,delete ,in edit mode it save and cancel button.The data is based on a custom list.In the list i have set the max to 4 but in DWP it doesn't seem to work. When in Edit mode or in Insert mode i want to validate this field

<SharePoint:formfield runat="server" id="ff9{$Pos}" ControlMode="Edit" FieldName="Quantity" ItemId="{@ID}" __designer:bind="{ddwrt:DataBind('u',concat('ff9',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Quantity')}" />

I want make sure the number being added is not greater that 4. Any ideas? Thanks

share|improve this question
please let me know how did you validated it. I am facing similar issue. – user3942 Jun 30 '11 at 10:37

2 Answers 2

I think you should create a customfield

and overrides the validate method

create custom field :

    public override void Validate()
   //make your validation here

share|improve this answer
Thanks but i did this using Sharepoint Designer. If i did build it in Visual Studio i could have taught of that earlier I need something on the client if it exists. – Patrick Aug 30 '10 at 23:38
up vote 0 down vote accepted

Fixed. I used the function PreSaveAction() to fix this

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.