Jump to content
Sign in to follow this  
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.

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.

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?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated