yggdrasil Posted August 2, 2018 Share Posted August 2, 2018 I tested this even on the default six theme but it seems the option that disables the dns inputs when someone selects default DNS on a domain does not work. I get a JS error: Uncaught ReferenceError: disableFields is not defined I think this is happening since as long I can remember using WHMCS. I don't want to believe this is a 3 year old bug so I was wondering if this is something on my installation or someone else also can replicate this. Just go to a domain and try selecting between the default or customer options in the DNS settings and it should generate the error. 0 Quote Link to comment Share on other sites More sharing options...
ServWise.com Posted August 27, 2020 Share Posted August 27, 2020 5 year old bug now 1 Quote Link to comment Share on other sites More sharing options...
yggdrasil Posted August 27, 2020 Author Share Posted August 27, 2020 6 hours ago, ServWise.com said: 5 year old bug now I never reported this to WHMCS and I guess nobody else did. They don't even know it exists. 0 Quote Link to comment Share on other sites More sharing options...
ServWise.com Posted August 27, 2020 Share Posted August 27, 2020 (edited) 30 minutes ago, yggdrasil said: I never reported this to WHMCS and I guess nobody else did. They don't even know it exists. Yeah it is not hard to fix but annoying when you find it, I actually built something a little more user friendly to replace it, no need to disable the fields but because I use a couple of domain reseller account as well as my own DNS the customer sometime just wants DNS only option and they need to set specific name servers for the DNS only option so I pre-populate them for them. Just add this to the top of the template clientareadomaindetails.tpl <script type="text/javascript"> function disableFields(tclass,value){ if (value=='usesw'){ document.getElementsByClassName(tclass)[0].value = 'ns1.servwise.com'; document.getElementsByClassName(tclass)[1].value = 'ns2.servwise.com'; document.getElementsByClassName(tclass)[2].value = 'ns3.servwise.com'; document.getElementsByClassName(tclass)[3].value = 'ns4.servwise.com'; document.getElementsByClassName(tclass)[4].value = ''; } else if (value=='enom'){ document.getElementsByClassName(tclass)[0].value = 'dns1.name-services.com'; document.getElementsByClassName(tclass)[1].value = 'dns2.name-services.com'; document.getElementsByClassName(tclass)[2].value = 'dns3.name-services.com'; document.getElementsByClassName(tclass)[3].value = ''; document.getElementsByClassName(tclass)[4].value = ''; } else if (value=='opensrs'){ document.getElementsByClassName(tclass)[0].value = 'ns1.systemdns.com'; document.getElementsByClassName(tclass)[1].value = 'ns2.systemdns.com'; document.getElementsByClassName(tclass)[2].value = 'ns3.systemdns.com'; document.getElementsByClassName(tclass)[3].value = ''; document.getElementsByClassName(tclass)[4].value = ''; } else { document.getElementsByClassName(tclass)[0].value = ''; document.getElementsByClassName(tclass)[1].value = ''; document.getElementsByClassName(tclass)[2].value = ''; document.getElementsByClassName(tclass)[3].value = ''; document.getElementsByClassName(tclass)[4].value = ''; } } </script> Then i have this code so the user can choose between using it with our hosting, DNS only via our website or their own name servers. <div class="radio"> <label> <input type="radio" name="nschoice" value="default" onclick="disableFields('domnsinputs','usesw')"{if $defaultns} checked{/if} /> {$LANG.sw_dns_servwise} </label> </div> <div class="radio"> <label> <input type="radio" name="nschoice" value="custom" onclick="disableFields('domnsinputs','{$registrar}')"{if !$defaultns && $nameservers[1].value eq "dns1.name-services.com" || $nameservers[1].value eq "ns1.systemdns.com"} checked{/if} /> {$LANG.sw_dns_DNSmanagement} </label> </div> <div class="radio"> <label> <input type="radio" name="nschoice" value="custom" onclick="disableFields('domnsinputs','')"{if !$defaultns && $nameservers[1].value neq "dns1.name-services.com" && $nameservers[1].value neq "ns1.systemdns.com"} checked{/if} /> {$LANG.nschoicecustom} </label> </div> Edited August 27, 2020 by ServWise.com 0 Quote Link to comment Share on other sites More sharing options...
yggdrasil Posted August 28, 2020 Author Share Posted August 28, 2020 15 hours ago, ServWise.com said: Yeah it is not hard to fix but annoying when you find it, I actually built something a little more user friendly to replace it, no need to disable the fields but because I use a couple of domain reseller account as well as my own DNS the customer sometime just wants DNS only option and they need to set specific name servers for the DNS only option so I pre-populate them for them. Just add this to the top of the template clientareadomaindetails.tpl <script type="text/javascript"> function disableFields(tclass,value){ if (value=='usesw'){ document.getElementsByClassName(tclass)[0].value = 'ns1.servwise.com'; document.getElementsByClassName(tclass)[1].value = 'ns2.servwise.com'; document.getElementsByClassName(tclass)[2].value = 'ns3.servwise.com'; document.getElementsByClassName(tclass)[3].value = 'ns4.servwise.com'; document.getElementsByClassName(tclass)[4].value = ''; } else if (value=='enom'){ document.getElementsByClassName(tclass)[0].value = 'dns1.name-services.com'; document.getElementsByClassName(tclass)[1].value = 'dns2.name-services.com'; document.getElementsByClassName(tclass)[2].value = 'dns3.name-services.com'; document.getElementsByClassName(tclass)[3].value = ''; document.getElementsByClassName(tclass)[4].value = ''; } else if (value=='opensrs'){ document.getElementsByClassName(tclass)[0].value = 'ns1.systemdns.com'; document.getElementsByClassName(tclass)[1].value = 'ns2.systemdns.com'; document.getElementsByClassName(tclass)[2].value = 'ns3.systemdns.com'; document.getElementsByClassName(tclass)[3].value = ''; document.getElementsByClassName(tclass)[4].value = ''; } else { document.getElementsByClassName(tclass)[0].value = ''; document.getElementsByClassName(tclass)[1].value = ''; document.getElementsByClassName(tclass)[2].value = ''; document.getElementsByClassName(tclass)[3].value = ''; document.getElementsByClassName(tclass)[4].value = ''; } } </script> Then i have this code so the user can choose between using it with our hosting, DNS only via our website or their own name servers. <div class="radio"> <label> <input type="radio" name="nschoice" value="default" onclick="disableFields('domnsinputs','usesw')"{if $defaultns} checked{/if} /> {$LANG.sw_dns_servwise} </label> </div> <div class="radio"> <label> <input type="radio" name="nschoice" value="custom" onclick="disableFields('domnsinputs','{$registrar}')"{if !$defaultns && $nameservers[1].value eq "dns1.name-services.com" || $nameservers[1].value eq "ns1.systemdns.com"} checked{/if} /> {$LANG.sw_dns_DNSmanagement} </label> </div> <div class="radio"> <label> <input type="radio" name="nschoice" value="custom" onclick="disableFields('domnsinputs','')"{if !$defaultns && $nameservers[1].value neq "dns1.name-services.com" && $nameservers[1].value neq "ns1.systemdns.com"} checked{/if} /> {$LANG.nschoicecustom} </label> </div> Thanks, I guess populating the fields with the nameservers is one way to fix it. I was surprised that such a small bug in the user interface caused so many troubles with people. Because they automatically start to complete the custom fields when they should not. It's very confusing to have the custom fields enabled and fillable when someone clicks on default DNS servers instead of just marking them as read only. 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.