Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Require a field in certain circumstances

Post Reply
CreationX
Posts: 8
Joined: Mon Sep 14, 2015 3:40 pm

Require a field in certain circumstances

Unread post by CreationX »

I have two fields when browsing to edit form that I need to require (not be blank) only under certain circumstances.

For example, I have 5 fields, A, B, C, D, E. D and E are only required to be filled out if A meets a certain criteria for example.

I was using the display condition, IF A = 1, display D and E, however it threw an error on all conditions where A != 1, because even though the field was hidden, it was requiring it to be filled out anyway.

So, what I am asking is, how can I set conditional required (non-blank) fields?
CreationX
Posts: 8
Joined: Mon Sep 14, 2015 3:40 pm

Re: Require a field in certain circumstances

Unread post by CreationX »

bump
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Require a field in certain circumstances

Unread post by admin »

CreationX,

You will need to set these fields to Can Be Left Blank and validate these things at the point of saving using nuOnSave() http://wiki.nubuilder.net/nubuilderv3/i ... Save.28.29.

You may also find that using nuEnable() and nuDisble() http://wiki.nubuilder.net/nubuilderv3/i ... C_value.29.

It won't hide the field but along with disabling it, it can also reset its value. And it will know if the field is a Text, Lookup etc.

Steven
CreationX
Posts: 8
Joined: Mon Sep 14, 2015 3:40 pm

Re: Require a field in certain circumstances

Unread post by CreationX »

Thank you, I am trying to do this with limited JavaScript knowledge.

I am also having a problem with dropdowns not selecting a default value when using static values (ex. 1|Yes|2|Maybe|3|No)

It comes up blank on edit form.
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Require a field in certain circumstances

Unread post by admin »

CreationX,

Setting a default is done with SQL..
Capture.PNG
Capture.PNG (29.88 KiB) Viewed 7112 times
Steven
CreationX
Posts: 8
Joined: Mon Sep 14, 2015 3:40 pm

Re: Require a field in certain circumstances

Unread post by CreationX »

Yes, unfortunately I have tried that.
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Require a field in certain circumstances

Unread post by admin »

Can you get the Default to work on a Text Object?

Steven
CreationX
Posts: 8
Joined: Mon Sep 14, 2015 3:40 pm

Re: Require a field in certain circumstances

Unread post by CreationX »

admin wrote:Can you get the Default to work on a Text Object?

Steven
Yeah, default works great on a text object.
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Require a field in certain circumstances

Unread post by admin »

Can you do a screen dump of the Default SQL and the list in SQL and share it here?

Steven
Post Reply