HowTo? onChange assign value to dtml-var
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. -Mark
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
Hi Shaw, unfortunately you have to lern how the web works ;) There is no stateful handling of application for itself. You either have to use a session product to glue distinct requests to one application or find another way. If you want to talk to a http-server you must do a request. You can of yourse use a Javascript and a frame to do requests without reloading the formular containing page itself, but you have to save the values into a session or directly in a DB (zodb or for heavy traffic in a RBMS) Regards Tino "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.
-Mark
_______________________________________________ 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 )
participants (3)
-
Joel Burton -
Shaw, Mark -
Tino Wildenhain