Thanks everyone. My solution was to use a plain old javascript variable and not a DTML variable. onChange="(first_name = this.value)" where first_name is a global javascript variable. -Mark -----Original Message----- From: Joel Burton [mailto:jburton@scw.org] Sent: Thursday, April 05, 2001 1:20 PM To: Shaw, Mark Cc: Zope@Zope. Org Subject: Re: [Zope] HowTo? onChange assign value to dtml-var On Thu, 5 Apr 2001, Shaw, Mark wrote:
Hello everyone,
Does anyone have an example of how to do the following:
Let's assume I have a form named form1 with a field named fld_first_name.
On any change in the value of that field, I would like to assign the new value to a dtml variable that was previously defined using <!--#call "REQUEST.set('first_name','First Name')"-->.
Something like this:
<input type="text" name="fld_first_name" onChange='<!--#call "REQUEST.set('first_name',fld_first_name.value)"-->' >
I would like to do this so that I can have access to the new value without the SUBMIT button being pressed.
Thanks in advance for any help/pointers/code examples provided.
Sorry, but, the DTML is long resolved and done before the web page ever gets to your browser, so you can't assign anything to DTML from a form action *while still on that page*. This isn't a Zope problem; its the whole fundamental client/server web thang. The onChange method could load a new page, or refresh the current page, passing the new name as it did so. -- Joel Burton <jburton@scw.org> Director of Information Systems, Support Center of Washington _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )