W3C home > Mailing lists > Public > www-forms@w3.org > January 2002

RE: simple question about buttons in conjunction with javascript

From: Mikko Honkala <honkkis@tml.hut.fi>
Date: Thu, 24 Jan 2002 14:38:36 +0200
To: "Roman Huditsch" <roman.huditsch@hico.com>, <www-forms@w3.org>
Hi Roman,

> How would I have to define a button in pure XFomrs, which starts
> a javascript when I click it?
> Do I have to use xform:dispatch?

For example:

	<xforms:caption>Run script</xforms:caption>
	<xforms:script ev:event="xforms:activate" .../>

> Is there a chance to define a button, which is able to set a
> "relevant"-attribute of a <xform:bind> to the values "yes" or
> "no" when I click it?

This is one way, there may be others:

<xforms:instance xmlns="">
	<isRelevant value="true"/>

<xforms:bind ref="/my/anotherItem" relevant="/my/isRelevant='true'"/>

  <xforms:caption>Set relevant</xforms:caption>
  <xforms:setValue ev:event="xforms:activate"

(I have not tested these, although they should work with X-Smiles, so there
are probably errors)

	Mikko Honkala
Received on Thursday, 24 January 2002 07:39:20 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:05 UTC