×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Auto populate extra fields

Auto populate extra fields 10 years 4 weeks ago #25568

  • Jonathan Appleton
  • Jonathan Appleton's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 12
  • Thank you received: 3
Hi
On our mailchimp list we have email, firstname and lastname all as required fields.
When registering using JomSocial and you tick the newsletter box it then reveals the 3 fields to be filled out but the user will have just written out those 3 exact same values above this so seems bad to have to ask them to type in their email, firstname and lastname once again
so im wondering if it would be possible to amend your CMC javascript that is triggered when you click newsletter and the fields are shown coudl it also copy the values from email, first name and last name down in to the newsletter fields.....
Woudl happily donate a small amount for example code to do that please
thanks
Jonathan
PS can you fix your docuemnts as many of your screen shots are not loading eg here compojoom.com/support/documentation/cmc/ch03s04
============

EDIT: solved by adding 3 lines to file below :)

I edited the file /media/plg_community_cmc/js/cmc.js

document.id('cmc_newsletter').addEvent('click', function() {
if(this.checked)
{
fields.setStyle('display', 'block');
$$('.cmc_req').addClass('required').set('required', 'required');
//added three lines below to copy email and name from main form to newsletter fields
document.getElementById('cmc_groups_FNAME').value = jomsForm.elements.jsfirstname.value;
document.getElementById('cmc_groups_LNAME').value = jomsForm.elements.jslastname.value;
document.getElementById('cmc_groups_EMAIL').value = jomsForm.elements.jsemail.value;
The following user(s) said Thank You: Johnny

Auto populate extra fields 10 years 3 weeks ago #25589

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Awesome! We plan to improve this with the next version. It won't be necessary at all to show the fields. We'll get the data from the fields you specify.

Cheers,
Daniel

Auto populate extra fields 9 years 10 months ago #26460

  • Johnny
  • Johnny's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 0
I also used this and it works perfectly! Thanks :)
  • Page:
  • 1
Time to create page: 0.137 seconds