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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 0 down vote accepted

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

share|improve this answer

I think you should create a customfield

and overrides the validate method

create custom field control

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

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.