cancel
Showing results for 
Search instead for 
Did you mean: 

How to force a mandatory input field?

Former Member
0 Kudos

Hello,

I have created a simple model which generates query results based on two input fields. I would like to set on of the fields as required, so for that I set it's required property to true.

When I run the model it indicates that the field is required by marking it wil a red astrik yet when I hit Submit no check is done to verify that the input field indeed contains a value.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Use javascript to do input field validation in clientside and give an alert or use message bar to display the error message.Try this

<hbj:button

id="...."

onClientClick="validate()"

.......(required attributes)/>

<script language="javascript">

function validate()"

{

alert("Enter some value");

}

</script>

u can do validation at server side also.

Regards,

tamil K

Former Member
0 Kudos

Thanks Guys, I just thought it is already integrated in the VC by default.

When you think about it, it could have been: When you mark a field as mandatory a javascript function is created automatically to validate this field...

Former Member
0 Kudos

Hi,

you can also do this:

On the submit button create a formular for "Disabled":

BOOL(IF(@FIELDNAME1=="" OR @FIELDNAME2=="",true,false))

Button is disabled until a value is entered.

Best regards

Frank