We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36527
    • 120 Posts
    Quote from: ministrycrm at Mar 01, 2010, 12:31 PM

    Thanks Moondawgy.

    This would be a good feature to add. I am welcome to input on how best to do this.

    I could add the types "fieldset, legend" to the Type: dropdown and that would add fieldset as a sortable "formfield" but you would need a start fieldset and end fieldset so that it would encapsulate the appropriate formfields. I don’t think this would be hard to code, but I am wondering about userability.

    Thoughts?


    No worries - to be accessible the form really needs:

    1. Fieldsets and Legends:

    <fieldset>
    <legend>Choose a flower factsheet</legend>
    <input id="roses" type="checkbox" title ="rose factsheet" name="roses" value="checkbox">
    <label for="roses">Roses</label>
    <input id="daffodils" type="checkbox" title="daffodil factsheet" name="daffodils" value="checkbox">
    <label for="daffodils">Daffodils</label>
    <input id="tulips" type="checkbox" title="tulip factsheet" name="tulips" value="checkbox">
    <label for="tulips">Tulips</label>
    </fieldset>

    2. Labels for inputs:

    Select the fact sheets you want</b>

    <input id="roses" type="checkbox" title ="rose factsheet" name="roses" value="checkbox">
    <label for="roses">Roses</label>
    <input id="daffodils" type="checkbox" title="daffodil factsheet" name="daffodils" value="checkbox">
    <label for="daffodils">Daffodils</label>
    <input id="tulips" type="checkbox" title="tulip factsheet" name="tulips" value="checkbox">
    <label for="tulips">Tulips</label>

    3. Tabindex:

    <label for="name">Name:</label>
    <input id="name" type="text" name="name" size="30" tabindex="1">

    Hope that helps smiley
      • 19636
      • 29 Posts
      Moondawgy

      Thanks.

      Labels are in there.

      I added fieldsets and tab index to my todo list.

      Would it be sufficient to use the sort order index as the tab order?
        • 36527
        • 120 Posts
        Brilliant stuff ministrycrm !!

        Yes I think it would be fine, as long as the sort order index is sequential otherwise it will be confusing when users tab through it and it jumps around, instead of to the next field smiley
          • 19636
          • 29 Posts
          I have an update ready.

          Added:
          Fieldset capability
          Class
          tabindex

          I will post update as soon as I can login. smiley

          Enjoy.
            • 36451
            • 264 Posts
            Joe, your module is very useful. I’ve just tested the first version of formbuilder, and it works very well. Keep the good work!
              • 22216
              • 8 Posts
              Dear Joe,

              I am a newbye with MODx and moreover with FormBuilder which is exactly what I needed! Many thanks for this great job.

              I have a very simple question: how do you retreive data from the DB to display then? How do you manage the "update" part to be able to update the different fields.

              One thing more, do you plan to add an option to upload a file?

              Many thanks!

              Maxime
                • 19636
                • 29 Posts
                There is a button that says "Download submissions for this form" This will output submissions to a csv file.

                For uploads, I am concerned by letting people upload files to your server that you could be opening up a security hole. If anyone has ideas on how to keep that secure then we could add that in the future.
                  • 13144
                  • 5 Posts
                  Great Module! Thanks for doing this.

                  Though I got some problems with rc2.

                  1. After following the install steps , (#3) what chunks are you refering to? I couldnt find a folder "template" at all huh
                  Am I missing something or have you forgotten to include some in the zip?

                  2. I got it working so far except the validation...
                  After investigating some, I found that there’s a "verify(); return false;" functions call in the onclick event of the submit button. But there’s no verify function anywhere!? Did I miss something? Well I haven’t looked at the validate jquery plugin included, but guessing by the javascript chunk code, there isn’t an onlick function required to validate the form.
                  (EDIT) Sorry I got the validation working. Forgot to set the correct form id in the jquery chunk script.

                  4. I’ve looked at the output frontend code. I got the same request as Moondawgy. This form code is not very good. Too much divs where none is really required. The biggest complain would be: Labels should be done via the
                  <label for="inputid">Label</label><input id="inputid" type="text"/>
                  ... So clicking on a label would select or focus the input element. - The input element doesn’t need a extra div aswell. Also a "form-row" div around all that is not needed. But that’s something to argue. Maybe put that as a option to wrap rows by a specified tag (div,span,p) and an optional class. Last but not least, input tags should be closed using
                  <input .. />
                  format to be correct xhtml.

                  Maybe have a look at http://www.cssplay.co.uk/menu/form.html to see how it’s done correct.
                  The less code the less problems styling (also xbrowser).

                  Thanks again for your work. Hope you’ll consider these things for a future release.
                    • 19636
                    • 29 Posts
                    Thanks iSoma

                    Answer to Question 1: I need to update the documentation. Initially I chunkified everything, but decided it was too chunky and stored these in the advanced form options for userability.

                    Answer to Question 2: I found a bug in the javascript, well not a bug but extraneous code.
                    Remove the following line from the Javascript:
                    onSuccess	: function() { console.log('Success!'); },


                    I also removed:
                    verify(); return false;


                    I will clean up my sloppy code for the next version. I will probably leave in the div container or use a p tag to wrap form elements. (I don’t like using br tags for formatting).

                    Something like this:
                    <div class="field">
                    <label for="lastname">last name : </label> 
                    <input name="lastname" id="lastname" type="text" tabindex="1" />
                    </div>
                    
                    -or-
                    
                    <p>
                    <label for="lastname">last name : </label> 
                    <input name="lastname" id="lastname" type="text" tabindex="1" />
                    </p>
                    


                    OR maybe it would be best put in the advanced form options and let ya’ll decide?? Your thoughts...

                    I will try to knock out a new version this week yet.

                    Thanks for your input. It is very much appreciated.
                      • 13144
                      • 5 Posts
                      Another suggestion after looking at the ufvalidator jquery plugin.

                      You could consider implementing the jquery form validation plugin: http://bassistance.de/jquery-plugins/jquery-plugin-validation/
                      Which offers a lot more options for validating and also far more flexible error message handling. Combines well with the ajax submit plugin mentioned there too, which could be something worth considering...

                      Thanks again!