Craft Posted May 8, 2020 Share Posted May 8, 2020 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. 0 Quote Link to comment Share on other sites More sharing options...
steph.hope Posted May 8, 2020 Share Posted May 8, 2020 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. 1 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 8, 2020 Share Posted May 8, 2020 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. 1 Quote Link to comment Share on other sites More sharing options...
Craft Posted May 8, 2020 Author Share Posted May 8, 2020 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? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 9, 2020 Share Posted May 9, 2020 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;} ... 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. 1 Quote Link to comment Share on other sites More sharing options...
Craft Posted May 9, 2020 Author Share Posted May 9, 2020 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;} ... 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 🙂 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.