namhost Posted May 13, 2020 Share Posted May 13, 2020 I found this which allows me to add a fields during domain configuration. I used this to add a dropdown where the user can select: - Company - Individual I also have two other fields: - Company Name - Your Name Using conditional "Conditional Requirements", i was able to get add the code below to public_html/resources/domains/additionalfields.php: foreach ($domainExtensions as $domainExtension) { $additionaldomainfields[$domainExtension][$legalTypeLabel] = array( "Name" => $legalTypeLabel, "Type" => "dropdown", "Options" => '1|Company,2|Individual', "Required" => true, ); $additionaldomainfields[$domainExtension]["Company Name"] = array( "Name" => "Company Name", "Type" => "text", "Size" => "100", 'Required' => [ $legalTypeLabel => [1], ], ); $additionaldomainfields[$domainExtension]["Your Name"] = array( "Name" => "Your Name", "Type" => "text", "Size" => "100", 'Required' => [ $legalTypeLabel => [2], ], ); } This works great and gives me this (see attachment). So the problems I have: It's showing a * next to both fields - I expect it to only show the asterisk next to the field that is required. So therefore, at first it must show the one field as required, then the second But ideally, I want the whole field hidden when it's not required. So my questions: Is there a way to add custom javascript upon field generation that can handle the show and hide logic as needed? Or will I just have to add my own custom javascript somewhere else? And if so, where? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.