kiava 1 Posted August 2, 2018 hi , how can i lock the customfield in my whmcs in clientdetails ? becuse i dont want my customer change details 0 Quote Share this post Link to post Share on other sites
brian! 3422 Posted August 3, 2018 On 02/08/2018 at 16:01, kiava said: hi , how can i lock the customfield in my whmcs in clientdetails ? because i don't want my customer change details depends on what type of custom field it is and whether you want to apply it to one or more customfields... what type of customfield is it - a text box, dropdown ?? each requires a slightly different solution. 1 Quote Share this post Link to post Share on other sites
kiava 1 Posted August 3, 2018 text box i want lock this in my clientdetails.tpl 0 Quote Share this post Link to post Share on other sites
kiava 1 Posted August 3, 2018 4 hours ago, brian! said: depends on what type of custom field it is and whether you want to apply it to one or more customfields... what type of customfield is it - a text box, dropdown ?? each requires a slightly different solution. in textbox i want lock textbox 0 Quote Share this post Link to post Share on other sites
brian! 3422 Posted August 4, 2018 19 hours ago, kiava said: in textbox i want lock textbox in clientareadetails.tpl, you would change... {$customfield.input} {$customfield.description} to... {if $customfield.id eq '42'}{$customfield.input|replace:'type="text"':'type="text" readonly'}{else}{$customfield.input}{/if} {$customfield.description} that example value of '42' is the ID value of the customfield, which you can obtain in various ways - one being to look at the source code in the browser of the text field that you want to make readonly... all other customfields will be editable, but any you specify will be read-only. 1 Quote Share this post Link to post Share on other sites
kiava 1 Posted August 5, 2018 thanks a lot i use your code for my site look like {if $customfield.id eq '62'}{$customfield.input|replace:'type="text"':'type="text" disabled="disabled"'} {elseif $customfield.id eq '76'}{$customfield.input|replace:'type="text"':'type="text" disabled="disabled"'}{else}{$customfield.input}{/if} {$customfield.description} thanks my problem was solved 0 Quote Share this post Link to post Share on other sites
kiava 1 Posted August 5, 2018 On 8/4/2018 at 9:23 PM, brian! said: in clientareadetails.tpl, you would change... {$customfield.input} {$customfield.description} to... {if $customfield.id eq '42'}{$customfield.input|replace:'type="text"':'type="text" readonly'}{else}{$customfield.input}{/if} {$customfield.description} that example value of '42' is the ID value of the customfield, which you can obtain in various ways - one being to look at the source code in the browser of the text field that you want to make readonly... all other customfields will be editable, but any you specify will be read-only. but we can edit with inspectelement and change it so it was not good for security can you help me for lock from database? 1 Quote Share this post Link to post Share on other sites
brian! 3422 Posted August 6, 2018 then you may need to write a CustomFieldSave action hook. 1 Quote Share this post Link to post Share on other sites