[Zope-dev] Using Java-Script with DTML
Thomas Weholt
Thomas@cintra.no
Thu, 29 Jun 2000 14:46:51 +0200
Hi
I`m trying to send a parameter to a java-script function and then use that
parameter in the java-script function to look up a record-set in a database
with a dtml-method. With no luck so far.
Ex.
<script language="javascript1.2>
function ShowStuff(params){
var text = "<dtml-in expr="sqlMethod(some_id=params>" <!-- this does
not work, of course. How I can I pass argument thru Javascript to the
sqlMethod ?? --->
alert (text);
}
</script>
<!--- lots of DTML --->
<a href=".." onClick="ShowStuff(<dtml-var some_id>);">...</a>
<!--- lots of DTML --->
The link sends an id to the java-script-method. A SQL method takes that id
as argument and returns a recordset. Or, that`s what I want to happen. How
can I get the sqlMethod to take the passed argument and return some data?? I
get the thing to work by using static content, like
<dtml-in expr="sqlMethod(some_id='1')">
But I need to pass the argument from somewhere else in the document.
Oh, this was one big mess. Hope it makes some sense.
Thomas