[Zope] HowTo? onChange assign value to dtml-var

Joel Burton jburton@scw.org
Thu, 5 Apr 2001 13:19:53 -0400 (EDT)


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