Pre-made form elements

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

I don't know what to call what I'm looking for - I'm building some forms and I don't want to have to re-create standard fields all the time. So I'm looking for someplace I can go to grab standard form controls (like birthdate fields, country lists, that sort of thing).

Any suggestions?

Thanks Smiling

Busy's picture

He has: 6,151 posts

Joined: May 2001

How a bout a function or a class (php), then when you want a form field you just do something like:

$form_field(type, name, length, id ...);

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

What? Copy + paste doesn't work for you Laughing out loud? I think Busy has a good idea, in fact, I think I'll try and code one tomorrow. It's a good excuse to play around with PHP.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

I don't think I made myself clear - I need a birthdate field, right? I don't want to type out all the months and days to choose from. I want to find that someplace to copy and paste. Other people are writing the backend on this so I just need the front end part for right now.

It would be the same if, say, you needed a list of countries to pick from, or US states or whatever.

timjpriebe's picture

He has: 2,667 posts

Joined: Dec 2004

Sounds like a good possible section in the new site... I'd love to help create a bunch of pre-made form elements.

Oh, and a quick search on Google didn't reveal much. But I'm sure you've already tried that, Megan. I know I've found a month listing before, but couldn't find it this time.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

timjpriebe;211230 wrote: Oh, and a quick search on Google didn't reveal much. But I'm sure you've already tried that, Megan. I know I've found a month listing before, but couldn't find it this time.

I tried searching but maybe I wasn't using the right terms or something, I don't know.

(I'm not actually doing a country list, was just using that as an example)

That would be good content for the new site! I'll put that into basecamp.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

The dojo toolkit includes a few widgets like a date picker. They're Javascript-heavy, rich form elements though, and I don't know if they degrade gracefully to normal form elements. There are assorted other scripts on the web like it, but they're probably overcomplicating things in this case.

Check out these posts and comments on 456 Berea Street and Bruce Lawson regarding country lists in forms.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.