Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Conditionally preventing an item from being saved or edited.

Locked
danielf
Posts: 44
Joined: Tue Jul 26, 2011 2:48 pm

Conditionally preventing an item from being saved or edited.

Unread post by danielf »

As per the title really.

I want to conditionally prevent a user from editing a field. It's much like the 'avoid blanks' or duplicates option, except it needs to be a custom condition. If the condition is met, and the user attempts to save a record, I want to bring up a dialogue box that informs the user he needs to amend another field before he can save this record, and prevent the current record being saved. Is there an easy way of doing this?

Thanks,

Dan.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Conditionally preventing an item from being saved or edi

Unread post by admin »

Dan,

You can create a function called nuBeforeSave().

http://wiki.nubuilder.com/tiki-index.ph ... eforeSave_

Steven
danielf
Posts: 44
Joined: Tue Jul 26, 2011 2:48 pm

Re: Conditionally preventing an item from being saved or edi

Unread post by danielf »

Thank you Steven, that does exactly what I want.

Dan.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Conditionally preventing an item from being saved or edi

Unread post by admin »

Great!
Locked