QuackFuzed.com is the personal ColdFusion coding blog of Matt Quackenbush. It exists primarily as a place for the author to learn, and hopefully to assist others in learning and/or avoiding some of the same pitfalls and mistakes. (Quack certainly makes enough mistakes daily to make up for the entire ColdFusion community.)

dynamicField: My First "Official" jQuery Plugin

Posted on January 12, 2010 at 1:48 PM in ColdFusion, jQuery

Anyone that knows me knows that I hate doing UI work. Why? Because I suck at it. Graphics, design, and layout are definitely not among my talents. Which is why I love jQuery so much. I can write a little bit of JavaScript - very little, in fact - add a plugin or two, and voila! I have a nice looking user interface for my application.

After using a few very handy form-related jQuery plugins and integrating them into my cfUniForm library, I decided it was time I go ahead and release a plugin of my own.

[Continue Reading]

Comments
(Comment Moderation is enabled. Your comment will not appear until approved.)

On 4/26/10 at 10:28 AM, Bryon said:

It would be great if this could handle groups of form elements. For example, say I want a phone number text field, but I would also like a drop down which is associated with that text field... say "Type" where it could be "Home", "Work", "Mobile", etc.

Can this plugin support that capability to create groups of form field elements? That would be great if it could.

On 4/26/10 at 1:42 PM, Matt Quackenbush said:

@ Byron - I have not yet had an opportunity to dig into adding support for a "group" of form elements. I definitely plan to do so at some point, but I currently just have too many other things that are sucking up my time.

Part of my "issue" is that I need to figure out how to effectively handle it within the confines of the Uni-Form markup, which is what all of my forms are based upon. As of the moment, I've not really gotten my head around that. Or, perhaps more specifically, I've not yet gotten my head around how to handle it for a wide range of markup styles. Such a thing would not be nearly as useful if it forced one (anyone) into a single markup style. Anyways, I just don't have the time available to me to focus on it. :-(

On 12/9/10 at 6:33 PM, Cesar said:

Hello Matt,

Thanks for this wonderful plugin. I been using it for a couples of weeks, nevertheless I came across a issue I cannot still figure out. Let's say we have a dynamic field set used to form a sql query. The first dynamic field is a dropdown with "("; the thing is when the "Add Row" button is pressed the new first field must be another dropdown with the values "AND, OR" in order to form a sql where statement with the corresponding AND or OR operator.

There is a simple way to achieve this task with the dynamicField plugin?

On 12/26/10 at 6:28 PM, cale said:

i agree with bryon... im also trying to write an app that has multiple phone numbers and a phone type for each phone number (work, mobile, office)

On 2/11/11 at 4:48 PM, William said:

Matt,

I grabbed your plugin and I am trying to use it. I get an error "Uncaught TypeError: Cannot call method 'replace' of undefined" when it tries to execute this;


baseName: f.children("input")
.attr("name")
.replace(/^(.+[_-])([0-9]+)$/,"$1"),


Do the class, id, name attr matter explicitly? This looks like a nice plugin.

Will

On 2/11/11 at 4:55 PM, Matt Quackenbush said:

@ Will - It sounds like you do not have a 'name' attribute on one (or more) of your inputs. The plugin is wired to require that attribute. As for the other attributes mentioned, I'm not sure off the top of my head. To be honest, I haven't looked at or even used the plugin in a very long time, so my mind has pushed a lot of other things ahead of it in the memory banks. ;-)

But check to make sure you have the attribute(s) in question.

HTH

On 2/16/11 at 2:27 AM, netgenerator said:

Hey nice plugin, thanks for sharing! I think I'll use it for my next project. Keep on coding :)

On 3/8/11 at 7:42 PM, sdfor said:

Thanks for your work! There may be issues with the remove when I use the plugin for more than one set of dynamic fields within one page. I had to make a changes to the binding of the click event for the remove, though my change is specific and not general enough for general consumption.
CodeBassRadio

Latest Articles

Eventually something really brilliant and witty will appear right here.

Calendar

January 2010
S M T W T F S
« Dec   Feb »
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Subscribe

Enter a valid email address.

The Obligatory Wish List