Jump to content
kiava

how can i lock customfield

Recommended Posts

hi , how can i lock the customfield in my whmcs in clientdetails ? becuse i dont want my customer change details

 

Share this post


Link to post
Share on other sites
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.

  • Like 1

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
19 hours ago, kiava said:

in textbox i want lock textbox

VFI0DK0.png

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.

  • Like 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
On 8/4/2018 at 9:23 PM, brian! said:

VFI0DK0.png

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?

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines