Home
The Toolkit for Online Communities
15889 Community Members, 0 members online, 2057 visitors today
Log In Register

Forum OpenACS Q&A: javascript for hiding/showing form elements

OpenACS Home : Forums : OpenACS Q&A : javascript for hiding/showing form elements

Icon of Envelope Request notifications

I want to integrate a js into survey_simple that hides a form element
whenever a user doesn't have to fill it out. Whenever the user wants
to fill it out anyways, he just clicks on a button and the form
element opens up.

I found an very good example, but it only works on IE:

http://www.anders.com/projects/javascript/form-dynamic_hide/



This example also works on Mozilla, but the form gets exchanged with
whitespace and not with nothing:

http://www.js-examples.com/example/?ex=97&mode=2


Does anyone already hava such an implementation or knows how to merge
the two little example scripts?

+
Posted by Jonathan Ellis on
it would be a lot easier to leave the input visible, but disabled.  good luck. :)
+
Posted by Andrei Popov on
how about putting form elements onto different layers with <div> and then stacking them & changing visibility props?  this wont, however, work in many (if not all) older browsers.
Error in include template "/usr/local/openacs.org/packages/forums/lib/message/row": invalid command name "domNode0x2e48d550 domNode0x7fe2126dfed0"
+
Posted by David Kuczek on
Funny, I thought that our bboard would cut out scripts, but noap...
+
Posted by Jonathan Ellis on
I don't think the 3.x bboard calls util_close_html_tags out of the box.  (And you'd still need to add "syn(SCRIPT) discard" to the list.)
+
Posted by Andrei Popov on
nice, albeit does not work in Opera, at least on the bboard page.
+
Posted by David Kuczek on
I suppose that if it doesn't work on the bboard it shouldn't work anywhere else on Opera... I am not sure what part of the code must be changed to make it Opera compliant, but you could recognize the browser with a js-sniffer and then automatically exchange that part of the code.
+
Posted by Matthew Terenzio on
Doesn't seem to work on netscape 4.77 on the MAC