Jump to content

Editing Registration Form


Craft

Recommended Posts

I would like to edit some fields in the registration form

How can I change a  mandatory field to not a mandatory?
How can I remove a field (Street Address 2) permanently?
How can I rename a field placeholder?
How to add the mandatory message (Please fill out this field) to the (Phone Number, Password & Confirm Password) fields?, I know that the system will give an error when the page loads onclick to Register button but I don't want the page loads until all the mandatory fields are filled up.

 

Link to comment
Share on other sites

You can make registration fields optional using General Setting > Other > Optional Client Profile Fields.

You can remove a field by editing the template:

To rename a placeholder it'd probably be best to create a language override: https://developers.whmcs.com/languages/overrides/ but you could also just edit the template if your WHMCS only uses one language.

Adding a message to the fields would also be a template edit as far as I understand.

Link to comment
Share on other sites

i'd go along with steph on this, but for the mandatory message, i'd be tempted to just tweak the relevant placeholder language overrides - you know they will already exist and would avoid the need to edit any templates.

there are hooks you could use to output a message on the checkout page, but I doubt where it would be shown (between form and payment details) would be useful for your situation.

whilst you could probably inject text anywhere on the page using js, if you have to, it would be easier to edit the template.

Link to comment
Share on other sites

17 hours ago, steph.hope said:

You can make registration fields optional using General Setting > Other > Optional Client Profile Fields.

You can remove a field by editing the template:

To rename a placeholder it'd probably be best to create a language override: https://developers.whmcs.com/languages/overrides/ but you could also just edit the template if your WHMCS only uses one language.

Adding a message to the fields would also be a template edit as far as I understand.

 

9 hours ago, brian! said:

i'd go along with steph on this, but for the mandatory message, i'd be tempted to just tweak the relevant placeholder language overrides - you know they will already exist and would avoid the need to edit any templates.

there are hooks you could use to output a message on the checkout page, but I doubt where it would be shown (between form and payment details) would be useful for your situation.

whilst you could probably inject text anywhere on the page using js, if you have to, it would be easier to edit the template.

Thanks guys.

Instead of editing the template, can I use hooks to remove a field from the registration form?

 

Link to comment
Share on other sites

14 hours ago, Craft said:

Instead of editing the template, can I use hooks to remove a field from the registration form?

can I give you a yes/no/maybe answer ? 😎

technically, the answer is yes... hell, you don't even need a hook as you can do it with CSS in a custom.css file - but the tricky part is if you want to remove something that ruins the styling of the page when it's not there, or you can't specify it well enough via css (note: if someone can start a crowdfunding site to buy the WHMCS developers a book on adding unique ids or names to these elements, it would be a wise investment!)

let's say you wanted to remove (hide) Address 2 from the registration form with CSS.

#registration .col-sm-12:nth-child(3){display: none;}

s893lsL.png

... so that works fine - but you can't always specify elements in WHMCS accurately, hence why steph's suggestion of editing the template is the way I would go... personally, I wouldn't go down the road of replacing div content using jQuery either.

i'd also suggest being careful about which fields you remove - just in case they are of importance when registering domains.

Link to comment
Share on other sites

8 hours ago, brian! said:

can I give you a yes/no/maybe answer ? 😎

technically, the answer is yes... hell, you don't even need a hook as you can do it with CSS in a custom.css file - but the tricky part is if you want to remove something that ruins the styling of the page when it's not there, or you can't specify it well enough via css (note: if someone can start a crowdfunding site to buy the WHMCS developers a book on adding unique ids or names to these elements, it would be a wise investment!)

let's say you wanted to remove (hide) Address 2 from the registration form with CSS.


#registration .col-sm-12:nth-child(3){display: none;}

s893lsL.png

... so that works fine - but you can't always specify elements in WHMCS accurately, hence why steph's suggestion of editing the template is the way I would go... personally, I wouldn't go down the road of replacing div content using jQuery either.

i'd also suggest being careful about which fields you remove - just in case they are of importance when registering domains.

Haha, nice trick, off-course that's much easier than editing the template 🙂

 

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