CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • how to embed javascript in civicontribute page?
Pages: [1]

Author Topic: how to embed javascript in civicontribute page?  (Read 1824 times)

webguy2

  • Guest
how to embed javascript in civicontribute page?
July 01, 2008, 12:42:16 pm
I've attached a pic of what I want to do.  When the user enters the # of units owned, I want a javascript to fire where I will calculate the cost which is dependent upon how many they own, and insert it in "Other Contribution".

I can create the javascipt but how do I embed the javascript in the page so it can be called?

Many thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: how to embed javascript in civicontribute page?
July 01, 2008, 01:03:52 pm

I'm assuming # of units is a custom field. You will need to customize the template (http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+and+Profile+Screens) and add the javascript there. You will need to "insert" the javascript onClick (or appropriate function) into the form element

you might want to get on IRC and we can chat more there and get more detailed

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

webguy2

  • Guest
Re: how to embed javascript in civicontribute page?
July 01, 2008, 01:16:46 pm
thanks - I'll see what I can and, though I've never done IRC, I'll check back with you if I run into some walls.

Many many thanks!!

webguy2

  • Guest
Re: how to embed javascript in civicontribute page?
July 01, 2008, 01:25:05 pm
ok, how do I get on IRC - never done it before?  thanks.

Do I just ask whoever is there or do I need to schedule a time when you are on IRC as well?

Thanks.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: how to embed javascript in civicontribute page?
July 01, 2008, 01:47:02 pm

just hop onto irc and ask you questions. between poland, india, US and NZ we do have pretty good coverage on that channel

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

webguy2

  • Guest
Re: how to embed javascript in civicontribute page?
July 01, 2008, 04:34:23 pm
lobo - I am a COMPLETE newbie to IRC.  What client do I need to get - I use mozilla 3 and heard there is a chatzilla around.  Once I have it, how to get to people helpful in CiviCRM?
<told you I was a complete newbie to IRC>

Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: how to embed javascript in civicontribute page?
July 01, 2008, 05:12:46 pm

check:

http://civicrm.org/participate

last line

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

webguy2

  • Guest
Re: how to embed javascript in civicontribute page?
July 02, 2008, 06:16:30 am
thanks, got in to irc and although it looks like there are people in the room, no one is chatting.  Let me know when you will be there and I will try to make it.

I found the main.tpl has javascript it in so I would like add the javascript there but the field is custom_6. and I don't know how to add a listener to a field, or which template to add that to.  Thanks.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • how to embed javascript in civicontribute page?

This forum was archived on 2017-11-26.