I added tables for postal codes linked with cities.
I created two fields:
[cb_villeauto] is a query that returns the name of the city according to [cb_codepostal], only it only works when you save the profile.
[cb_villeautodelim] which is a delimiter that displays the city and reported cp
Now I would like to create an action that updates [cb_ville] when [cb_codepostal] is changed
Javascript would be something like
"on" will not work with CB. Our jQuery is rather out of date (to be fixed in CB 2.0 as there are backwards compatibility issues to be addressed). Your selectors are also not valid, you need to use a class, ID, element, etc.. Fields are set with their name as the ID for most basic fieldtypes so the below should work depending on what type of fields you're using.
Have no idea how your get_ville function works, but the above will at least change the value based off your postal code field being changed.
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.
It was just an example. I would want add something wich auto-complete the field "town" after the field "Zipcode" is enter. All in ajax. I see the plugin "auto action". Can I do that with this or is there another maner, please ?
I have a table with town and zip, I can implemente all the js if necessary, but I don't know how to add the event on the field.
CB Auto Actions can at the least add the jQuery to the header of the page. You'd need to use the registration form display trigger and the profile edit display trigger. The Code action with Method set to jQuery will let you add jQuery and/or load jQuery plugins on the page. You may want to look into auto complete jQuery plugins as there's probably one available that you could just load in and use it to cut down on writing a bunch of jQuery to do it.
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.