Jump to content

HOW TO: Resize a custom field's displayed field length


Recommended Posts

By default custom fields all have a field length of 30. Use this code to show a resized field length to what ever you wish.

 

Eg for customfields[5] resized to show a field of 18 characters...

{$customfields.5.input|replace:'size="30"':'size="18"'}

Cheers,

Paul

Link to comment
Share on other sites

  • 4 years later...

Thank you Iceman!

 

And if you need to add something else on the input, such as placeholder, maxlength, onchange, readonly etc. You can do like this:

 

{$customfields.input|replace:'size="30"':'size="18"'|replace:'>':'maxlength="10" onchange="JavaScript(this)" readonly="readonly" />'}

 

Note that the

{$customfields.input ...

this time doesn't have a number following, which would act for every custom field within the related code/area.

 

;)

Link to comment
Share on other sites

  • 2 weeks later...
This HOWTO doesn't seem to be working for me. Has there been a change to the process for customising the input field length of a custom field?

 

Maybe it does still work, but the default length is no longer "30". It seems MUCH longer than that on my registration form.

 

I'm not sure, it still works for me. I'm using WHMCS version 4.4.2. Are you sure you checked everything precisely?

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