cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandor Szego <SSz...@Saba.com>
Subject RE: Default names in modular DB Actions and Javascript.
Date Thu, 17 Oct 2002 19:19:27 GMT
I am not familiar with Modular Database Actions, but is it possible to do
the following:

<input value="" name="price.cost" type="hidden">

<select name="selectedPrice"
	onChange="return fill_value("price.cost", selectedPrice);">
  <option value=""> -- Select a Price  -- </option>
  <option value="$1.00|OnePrice"> This is a price</option>
  <option value="$1.00|AnotherPrice">Another Good Price</option>
</select>

(i.e. quote the name of the hidden field)

function fill_value (fieldName,value) {
	var form = document.forms[0];
	var field = form[fieldName];
	field.value = value;
}

Sandor

-----Original Message-----
From: Antonio Gallardo Rivera [mailto:agallardo@agsoftware.dnsalias.com]
Sent: Thursday, October 17, 2002 12:14 PM
To: cocoon-dev@xml.apache.org
Subject: Default names in modular DB Actions and Javascript.


Hi,

I am using Modular Database Actions. The default name of the fields of a
table 
is defined:

tableName.fieldName

The problem is that this kind of parameters names in javascript is
interpreted 
as 

Object.property.

Then If we are trying to use Modular Databse Actions with javascript. This 
will not work in his default parameters name. Its conflicting.

Example:

I need to fill the hidden paramter after a user select an option:

The parameter is:
<input value="" name="price.cost" type="hidden">

<select name="selectedPrice"
	onChange="return fill_value(price.cost, selectedPrice);">
  <option value=""> -- Select a Price  -- </option>
  <option value="$1.00|OnePrice"> This is a price</option>
  <option value="$1.00|AnotherPrice">Another Good Price</option>
</select>


As you can see the onchange will not work on Javascript.

Well, I know that I can change the defaults names to make it work, but can
be 
better if we can choose a better syntaxis of the default names.

I hope this example illustrate well the problem I am trying to show.

Regards,

Antonio Gallardo

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org

Mime
View raw message