[ome-devel] making javascript work in the HTML templates

Melissa Yung melimelau at yahoo.com.au
Mon Jul 31 08:06:47 BST 2006


Hey 
   
  Yes the function does get called. The whole code actually works fine when we tried somewhere else as a normal HTML but as an OME .tmpl file it doesn't...
   
  Thanks for your help


august <august at develop.ment.org> wrote:
  > This javascript code works fine but when we pasted it
> in one of the .tmpl file for OME it doesn't.
> Any ideas?

With javascript in webbrowsers, there is practically unlimited
possibilities for things to go wrong.

Where are things going wrong?

First, are you sure that the function "addColumn" is being called at
all?

Just put an "alert('hello')" in there and see if that gets called when
you click the button. If not, then you might have to put the script
declaration somewhere else, perhaps after the form declaration.

Also, if the script is called and the problem is elsewhere, it might be
that "workset" is inside a 'div' or some other element and the path is
wrong. so, instead you might try:

hi = document.forms['workset'].column1_name.value;

-august.


> 
> Thanks.
> 
>  
> 
> function addColumn(workset)
> {
>     hi = document.workset.column1_name.value;
>     alert("Hi" + hi);
> }
> 
>    
> 
>   
>  [input] > name="column1_name">
>  [input] > onClick="addColumn(workset)">
> 



 Send instant messages to your online friends http://au.messenger.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20060731/f237110b/attachment.htm 


More information about the ome-devel mailing list