R – sharepoint validate custom field

camllistsharepoint

I cave created a custom list in sharepoint (created and provisioned to the 12 hive)

how can i perform validation on certain fields of the list when a new list item is added?

i think i can do it through the "itemadding" event reciever, but is there a more elegant sharepoint way?

eg i just want to check an email field has a valid email format.

Best Answer

I think you have to options. As you have already mentioned using a event receiver would be one way. But I think a more elegant and above all a more SharePoint like way would be implementing your own custom field type and field control.

This will give you the option to validate the mail address before any event receiver is triggered and to react with an validation message to the user giving him the option to correct his input.

Related Topic