Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Add script to autofill streetname and city to cb registration form

  • TheoSp
  • TheoSp
  • OFFLINE
  • Posts: 22
  • Thanks: 0
  • Karma: 0
8 months 1 week ago - 8 months 1 week ago #337297 by TheoSp
Hello,

I have nice looking  cb registration form with fields postalcode, housenumber, streetname and cityname.
Now I have a js (ajax) script to autofill streetname and cityname by filled in postalcode and housenumber.
How can I add the script to the form? Is there a html or php file I can modify?

Thanks, Theo
Last edit: 8 months 1 week ago by TheoSp.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 months 1 week ago #337302 by krileon
Easiest way is to use CB Auto Actions. You can then inject your script into the registration form using registration form display triggers.

We do not provide core file modification support in any way and your changes will be lost when you update CB.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • TheoSp
  • TheoSp
  • OFFLINE
  • Posts: 22
  • Thanks: 0
  • Karma: 0
8 months 1 week ago #337305 by TheoSp
Thanks for answering.
What I also need is code added to the field like:
Postcode <input type=text id=postcode onkeyup='check_pc("postcode",this.value)' autofocus>
How can I do that?

Thanks, Theo

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 months 1 week ago #337306 by krileon
As a field? Use Custom HTML field. Note your JS might be filtered out by Joomla's WYSIWYG though.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • TheoSp
  • TheoSp
  • OFFLINE
  • Posts: 22
  • Thanks: 0
  • Karma: 0
8 months 1 week ago #337307 by TheoSp
I already tried that. But we have field title and field name and a editor to put html code.
But how do I combine the code with de field name?
Normally in html de fieldname is within the code like:
<tr><td>Postcode</td> <td><input type=text id=postcode onkeyup='check_pc("postcode",this.value)' autofocus></td></tr>

Theo

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 months 1 week ago #337310 by krileon
You just set the field name in the Custom HTML fields title parameter or set it to display on 2 lines without a title then format the HTML however you want.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum