[Zope] Fancy selection with checkboxes

Thomas Bennett bennetttm at appstate.edu
Tue Jan 11 08:57:04 EST 2005


Below is another javascript my associate found recently on the WEB at

http://tech.irt.org/articles/script.htm

 that might be helpful to you or others.  Although the example shown
below is not checkboxes you might be able to find more helpful
information on checkboxes at that URL .

  The script Below lets you insert a value into a drop down list from an
input box.  The drop down is populated from a database field in this
case.  This functionality is similar to Access database where if the
value you want is not in the drop down it can be added by typing it in
the top of the drop down. The javascript will add the input box value
onChange to the drop down and it will make that input the selected
value.  Once this new value is added to the database that value is
available in the drop down box from then on.  Also, if no value is put
in the input box then the selected value is an empty string.




Thomas

    
<input type="text" name="newvalue" value="" size="30" />
<select name="f1" size="1" onChange="document.dbaddform.newvalue.value=document.dbaddform.f1.options[document.dbaddform.f1.selectedIndex].value;document.dbaddform.f1.value=''">
  <option value="" selected="selected">           </option>
  <dtml-in myDBtable_column_dropdown>
    <option value="<dtml-var my_column_value>"><dtml-var my_column_value></option>
  </dtml-in>
</select>


On Tue, 2005-01-11 at 07:22, Jonathan Hobbs wrote:
> From: "Florian Reiser" <florian_reiser at gmx.de>
> >
> > do you have an idea, where I find such an javascript?
> >
> > Greets
> >
> > Florian
> > >
> > >
> > > --On Montag, 10. Januar 2005 17:14 Uhr +0100 Florian Reiser
> > > <florian_reiser at gmx.de> wrote:
> > >
> > > > Hello Zopistas,
> > > >
> > > > I have an hierarchical structure (e.g. folders).
> > > > With this structure I want to generate a tree in Zope, where each item
> > > > has a checkmark.
> > > >
> > > > If I select one checker, then all items below it should be selected,
> > > too.
> > > >
> > > > If I then uncheck one checker, then the checker above that, should
> > > appear
> > > > gray.
> > > >
> > > > Maybe you know this tree from graphical tape backup applications.
> > > >
> > > > Is there a product for zope, which helps me generating such a tree?
> > > >
> > >
> > > This is basically an issue that you would solve on the client-side using
> > > Javascript.
> 
> Here is a tutorial on using javascript with html forms:
> 
> http://www.webdevelopersjournal.com/articles/jscript_forms1.html
> 
> You can also google for javascript code (many web sites offer free js
> routines which you can modify to suit your needs).
> 
> 
> Jonathan
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )



More information about the Zope mailing list