Forums | Mahara Community

Developers /
optgroup in Pieforms?


anonymous profile picture
Account deleted
Posts: 117

17 May 2009, 10:12

Anybody know if there's a way to create optgroups in select boxes with Pieforms?  The only documentation I could find for Pieforms online seems to be very basic and incomplete.  I'm changing the "city" field in the profile to a state/province select box and need to separate the states/provinces by country (U.S., Canada, and Australia) by using option groups.  Any ideas?

Thanks

anonymous profile picture
Account deleted
Posts: 117

17 May 2009, 10:49

Okay, I found the Pieforms code that handles select boxes and, as it is, it cannot do optgroups.  However, it shouldn't be too difficult to add that feature in there.
anonymous profile picture
Account deleted
Posts: 1643

17 May 2009, 17:25

Hi. The best place to get the documentation is from the Pieforms SVN repository: https://pieforms.svn.sourceforge.net/svnroot/pieforms

If you come up with a patch, and send it to me, I could apply it to pieforms upstream so you don't have to maintain it Wink

anonymous profile picture
Account deleted
Posts: 117

25 May 2009, 19:11

There seems to be several missing pages in the docs for Pieforms on Source Forge. I did modify the select element and just emailed it to you.

Next question, is there an easy way to add an onload event to a page?  I modified the employment history add and edit forms with a "I am currently employed here" checkbox that disables the end date input.  Now I just need to add an onload event to disable it the end date input on the edit page if the user currently works at the job they are editing.  I could just add a Smarty variable to the body tag in the header, but before I do that I figured I should find out if Mahara has some built in function to add an onload.

anonymous profile picture
Account deleted
Posts: 3

19 April 2010, 5:07

Hi stephen,

                    I was wondering if you could share this patch. I´m customizing the artefact/resume and I need to set optgroups in a select box for new composites elements.

 

TIA,

Federico

anonymous profile picture
Account deleted
Posts: 117

03 May 2010, 15:35

I emailed it to Nigel, but the version I emailed to him had a bug.  I'm not sure if he fixed it and added it to the Pieforms repository or not.

I'm not sure where my code for that is, if I still have it.  We are in the process of removing Pieforms and MochiKit completely from our Mahara install.  We have replaced MochiKit with jQuery, which fits our needs much better. Most of our forms are just coded in the templates and submitted via AJAX now.  Works much better for us.

anonymous profile picture
Account deleted
Posts: 3

05 May 2010, 12:13

Uppsss sorry to hear that you have to change all that. I have to admit that I have considered going to jquery too, but IMHO at this point I think it's better to add more funcionality to mahara rather than adding more complexity over the presentation layer. 

Thank you very much Stephen. 

 

 

anonymous profile picture
Account deleted
Posts: 117

08 May 2010, 1:53

If we didn't have a team of developers working on our site, I probably would have opted to leave MochiKit and Pieforms in.  When it was just me working on the site, I had just added jQuery using the no conflict feature so that both jQuery and MochiKit could exist together.  That worked pretty well, but in order to reduce loading times, we started to strip out code that we could do without.

8 results