[support] Javascript and CCK fields

Joel Willers joel.willers at sigler.com
Thu Mar 3 13:10:49 UTC 2011


Thanks for the suggestions.  I am planning to start this today.  Deep down I was hoping someone would know of a module that used tokens to control behavior of the CCK form fields.  

 

Also, has anyone ever used the module ‘editable fields’ using views to show all contents for accounting/inventory?  Seems powerful to be able to edit all of dozens of nodes/fields at a time, but is the submission interface useful?

 

Thanks again for all of the suggestions and help.  I’m fairly new to Drupal, and am really loving it.  I’m looking forward to DrupalCon, as well.  Hope to see some you there!

 

Joel

 

 

From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On Behalf Of Carl Wiedemann
Sent: Wednesday, March 02, 2011 5:46 PM
To: support at drupal.org
Subject: Re: [support] Javascript and CCK fields

 

	If you don't care that it's on every page, couldn't you just add it to
	the .info file of the theme?

 

You could, but then the JS is dependent on the theme. Switching the theme or usage of an admin theme could affect the functionality.

 

On Wed, Mar 2, 2011 at 2:48 PM, Anthony Malkoun <malkouna at yahoo.com.au> wrote:

If you don't care that it's on every page, couldn't you just add it to
the .info file of the theme?


On 6:59 AM, Carl Wiedemann wrote:
> If you don't care that the JS is added on every page, you might as
> well put it in hook_init. Otherwise if you want to use the same JS on
> multiple forms you would need multiple #after_build or #theme
> callbacks, which is repetitive and a little messy. Write your JS so
> that if indicative elements aren't present in the DOM it returns early.
>
> On Wed, Mar 2, 2011 at 6:53 AM, Joel Willers <joel.willers at sigler.com

> <mailto:joel.willers at sigler.com>> wrote:
>
>     I’m looking to do calculations between CCK fields.  I’ve found
>     some cool ways to add Javascript to a page, but before I get too
>     far into this, I figured I’d ask for some quick advice to see if
>     there was a better way.
>
>     Basically, I’m looking to do math on an ‘onchange’ event.  If
>     Field A is set (base) and Field B is changed, Field C and D
>     automatically update.  Similarly, if C changes, B and D update,
>     and same for D changing B and C.  I’m planning to use the
>     technique described at:
>
>     http://switchbackcms.com/blog/right-way-include-javascript-your-drupal-form,
>     but at http://drupal.org/node/322290 (#7) there is talk of adding
>     a theme function, which I’m guessing I could do using a nice
>     tpl.php file.
>
>     Any suggestions are welcome, especially if there is an already
>     existing module for field relationships.
>
>     Joel
>
>     **
>
>
>     --
>     [ Drupal support list | http://lists.drupal.org/ ]
>
>

--

[ Drupal support list | http://lists.drupal.org/ ]

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20110303/bf4fcc52/attachment.html 


More information about the support mailing list