Silly Java Question

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
User avatar
dominique.beaudin
Posts: 49
Joined: Tue Mar 06, 2018

06 Dec 2018

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();

}

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

06 Dec 2018

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 2220 times

User avatar
dominique.beaudin
Posts: 49
Joined: Tue Mar 06, 2018

06 Dec 2018

Thank you, I will correct that. I am concluding that else if statements are not supported? thanks

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

06 Dec 2018

Hi!

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

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests