Page 1 of 1

Silly Java Question

Posted: 06 Dec 2018
by dominique.beaudin
Hello,
I followed the instructions to do a conditional Show/hide required/not for a drop down- it works great, but I have 4 different values in the drop down and each need to have different items be visible when they are selected.

I am not a Java expert, but my attempt to use else if statements failed completely.

Any help is appreciated!


function checktype(){

if(fd.field('Reason_x0020_For_x0020_Invoice_x').value()=='Contractor got GW Coverage under Carrier'){

$('.number-hide').show();
$('.number-hide').FieldRequired(true);
$('.related-equipment').hide();
}
else{

//fd.field('Reason_x0020_For_x0020_Invoice_x').value('Item Adjustment for Equipment'); - this on should show related-equipment

$('.number-hide').hide();
$('.number-hide').titleRequired(True);
$('.related-equipment').hide();

}

Re: Silly Java Question

Posted: 06 Dec 2018
by AlexZver
Dear Dominique,

It seems you have some typos in your code:

1) FieldRequired(true); instead of titleRequired(true);

There is no such a function.

2) titleRequired(True); instead of titleRequired(true);

JavaScript is case-sensitive language.

Screenshot_118.png
Screenshot_118.png (26.46 KiB) Viewed 2219 times

Re: Silly Java Question

Posted: 06 Dec 2018
by dominique.beaudin
Thank you, I will correct that. I am concluding that else if statements are not supported? thanks

Re: Silly Java Question

Posted: 06 Dec 2018
by AlexZver
Hi!

No, "else if" statements are fully supported: https://developer.mozilla.org/en-US/doc ... /if...else