Jump to content

how can i lock customfield


kiava

Recommended Posts

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.

Link to comment
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

Link to comment
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.

Link to comment
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

Link to comment
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?

Link to comment
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.

  • 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