Site logo

Archived topic

BuddyPress custom js code into GP?

20 replies · Started by Carsten on November 23, 2018

Viewing posts 1–15 of 21

Hi there, I just purchased GP Pro to be able to put in som js code to auto fill the mandatory 'subject' field in BuddyPress private message. I created a Custom Hook and copied the code into here, but with no effect?

'You may use the following js(in document ready block) to add the subject on your own'
<script>
jQuery(‘#send_message_form’).submit( function() {
jQuery(‘#subject’).val(“Some message subject”);
});
</script>

What am I doing wrong?

Regards
Carsten

Hi there,

Thanks for the custom!
Can you check that you have jQuery enqueued. GP doesn't add it, unless you are using the Sticky Navigation.

Hi David, I am not quite sure how i do that?

'Can you check that you have jQuery enqueued.'

Regards
Carsten

Can you provide a link to your Site?
You can edit your original topic and use the Site URL field for privacy

Sure

Got a password? :)

You need admin access?

Is there a private way to share this?

Don't need admin, its requesting a password to enter the Site.

Ohh yes sorry, I turn this of now

OK, so good news is jQuery is loading but there is a 404 error on the buddyregistration.js. I assume this is the script thats required for the registration. Can you try reinstalling the buddyregistration plugin?

I think it was a third part registration plugin, which causes this error, it is deactivated now, would you please try again?

I am still seeing the 404 error on buddyregistration.js also there is a script fpr count.logonike that is also failing on a time out.

Need to really resolve those issues first.

I hope this is fixed now

OK, so hook your Javascript wrapped like this:

<script type="text/javascript">
  jQuery(document).ready(function() {
    Script in here
  });
</script>
This archived topic is closed to new replies.