.keyup function no longer working in Content Builder Editable Template

  • kenryanjr
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 134
  • Thank you received: 0

kenryanjr created the topic: .keyup function no longer working in Content Builder Editable Template

I was using the code below to take the user's first name (cb_35) and last name (cb_36) and concatenate them into full name (cb_55). I don't know when it stopped working. But it did. Any reason this would no longer work? I am using Purity III template.

I have tried many different variations of functions that should do the same thing. But they don't work either. I am sure it was after an update of the template or a module or plugin...but I don't really know what may have caused it.

This message contains confidential information

<script type="text/javascript">
$('#cb_35, #cb_36').keyup(function(){
    var fName = $('#cb_35').val(),
        lName = $('#cb_36').val();
    
    var cmpName = fName+ " " +lName;
    $('#cb_55').val(cmpName);    
    
});
</script>
#237697
  • Posts: 2553
  • Karma: 87
  • Thank you received: 343

mihaela replied the topic: .keyup function no longer working in Content Builder Editable Template

Hello,

Please try using the following solution.

Go to the View tab of the List view that you have created.

In the Editable column for the field with the ID cb_55 click on the [text] . In the pop-up window that appears click on Scripts tab.
Then in the Init(JS) section put the following code:
contentbuilder.onSubmit(
function(){
contentbuilder._('NAMEOFCB55').value = contentbuilder._('NAMEOFCB35').value + ' ' + contentbuilder._('NAMEOFCB36').value;
return true;
}
);
In the code above you have to replace NAMEOFCB55 with the Name of the field with the id cb_55. Also, replace NAMEOFCB35 and NAMEOFCB36 with the names of those elemetns with ID's cb_35 and cb_36, respectfully.

Whis will work in a way that it will fill the full name field with values form fields first name and last name at the moment that you SAVE the view.

You can take a look at the topic regarding a similar issue here crosstec.org/en/forums/37-contentbuilder...please.html?start=18 .

Regards,

Mihaela
#237699
  • kenryanjr
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 134
  • Thank you received: 0

kenryanjr replied the topic: .keyup function no longer working in Content Builder Editable Template

I solved this late last night. I added the google api jquery. No idea why it worked before and then it didn't.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
  $("#cb_7, #cb_8").keyup(function(){
    
    var fName = $("#cb_7").val(),
        lName = $("#cb_8").val();
    
    var cmpName = fName+ " " +lName;
    $("#cb_9").val(cmpName);    
    
});
</script>
#237719
  • Posts: 2553
  • Karma: 87
  • Thank you received: 343

mihaela replied the topic: .keyup function no longer working in Content Builder Editable Template

Hello,

I'm glad that you have managed to resolve the issue this way.

Regards,

Mihaela
#237725
Moderators: ForumSupporttomeperica
Time to create page: 0.075 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here