Working with Cocoon 2.1.8
 
I am trying to create a simple event that copies the value entered in one 
field, into another.
 
The form definition looks like:
 
<fd:field id="SiteCode" required="true">
 <fd:label>Site Code</fd:label>
 <fd:datatype base="string"/> 
 <fd:on-value-changed>
   <javascript>
     java.lang.System.err.println("Site Code changed from " + event.oldValue + 
" to " + event.newValue);
     var value = event.source.value;
     var typewidget = event.source.lookupWidget("../SampleCode");
     typewidget.setValue(value);  
   </javascript>
 </fd:on-value-changed>            
</fd:field> 
 
<fd:field id="SampleCode" >
 <fd:label>Sample Code</fd:label>
 <fd:datatype base="string"/> 
</fd:field> 
 
ie. the intent is that when SiteCode is changed, this value
becomes the default for the SampleCode.
 
The above does not work.  
 
I am not sure where/how the system adds in this Javascript;
the source code for the output web page does not look any
different from before, so I am sure I am missing something
obvious.
 
Thanks
Derek

-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their 
support.

Reply via email to