Show Hide Divs Using Mootools

CodeLab 28 Dec, 2008

I Want To Show Hide Divs Using Mootools (Or Whatever Works Best With Chronoforms For This Particular Thing)
What I Exactly Want Is...
If I Select "Option 1" From A Dropdown..
I Want To Hide All Divs But "Div1"

If I Select "Option 2" From Dropdown
I Want To Hide All Divs But "Div2"
And So On...

Something Like If I Click "Add More" It Will Add A New Div With A TextBox, Quite A Bit Like Accordion

Definitely I Dont Want Full Code To Be Written For Me..
I Want Some Tips About How To Do It With Chronoforms..
I Did Not See Any Such Thing In Showcase...

Thanks ๐Ÿ™‚
GreyHead 28 Dec, 2008
Hi codelab,

Please take a look at this thread where we use some MooTools/JavaScript to do something similar. Please see if that's enough to get you going.

CodeLab 28 Dec, 2008
Hi Bob..
Thanks For Quick Reply...
I Had Been Trying To Make It Work, I Think I Am Quite Close To It...

How About Adding New Divs/Controls Like In AccordionDemo

How Do I Make It Work With Chrono...๐Ÿคจ
GreyHead 28 Dec, 2008
Hi CodeLab,

Yes you can. I've done it with the accordion style - see here. Scroll down and you'll see that four team members are shown in an accordion by default. If you change the 'TeamSize' drop-down then you'll see more elements in the accordion.

CodeLab 29 Dec, 2008
Hi Bob,
Thanks For The Link. Excellent Piece Of Work ๐Ÿ™‚

Was Wondering, If That Form Saves Info To Database...
If It Does, Then It Would Probably Need Custom DB Schema And Some Extra Code.. (Actually Lot Of Extra Code ๐Ÿคฃ )

I Am On Quite A Similar Thing, And I Think My Form Needs Custom DB Schema And Lot Of Extra Code To Make It Work..
Any Comments..
GreyHead 29 Dec, 2008
Hi CodeLab,

Yes it does save to the database; and yes there is quite a lot of custom code in there.

The form is pretty much PHP driven, there's about 1000 lines of code altogether so not that big. The data is packed away into just four fields in the database and then re-expanded to be downaloaded into an Excel spreadsheet.

The schema really does depend on what you want to do with the data. In this case the client (wrongly IMHO) wants to manage it all through Excel so I can keep the schema really simple. I have another similar app - a three part form where the client wants to maintain their 'old' format so we ended up with 50 or 60 columns in the main table.

You can handle pretty much anything using ChronoForms - though I suspect v 3.0 isn't as flexible with the Autogenerated code as 2.5 was. But there does come a time when it's worth making the switch into a custom extension. I think the boundary is linked to the need for table admin which ChronoForms does not do so well.

This topic is locked and no more replies can be posted.