Posted by jeditdog on January 6, 2013 at 7:08am
I'm creating a form where there will be a text field that requires 1 entry.
I'm want to add a button so they user can enter more than 1 value. -- in this case clicing the button would popup a new text field.
They would have some edit abilities, so when I populate the form with saved data, each value would show up in its own text box & then the button would be there if they wanted to add another value.
I've got some idea on how to do this-- some I think Drupal will not like.
Are there any suggestions on how to accomplish this or where I should look?
thanks
Comments
Drupal fields allow for this
Drupal fields allow for this out of the box. Just select unlimited (or a set number above one) values on the field configuration page.
Jaypan We build websites
I get that this can happen
I get that this can happen out of the box, but I really need to customize this functionality.
some needs:
I'd like to use what is there, but it looks difficult to customize beyond what's there. Do you have suggestions on how to do this or at least an article to read?
-------------
The main man of Set Sail's Daycare Management Software :)
_
Tweaking existing functionality is likely to be far easier than recreating this from scratch for only minor changes-- seems like you mostly need to tweak the js. And you might be able to use field_collection module which will allow bundled fields to add items simultaneously without coding anything, so that would leave just turning off the ordering functionality.
_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.
will use field_collection
I agree, tweaking is a better idea, but I've really no idea where to start.
I will use the field_collection module -- sounds really useful for what I'm doing.
Any suggestions on where to start in the the Javascript?
Thank you for the suggestions thus far.
-------------
The main man of Set Sail's Daycare Management Software :)
_
I'm not much of a js guru, but I would start by inspecting the page to see which js enables the reordering. Also, iirc, there's a 'show row weights' link that disables the js reordering-- maybe see how that works. Also, you'll want to do a form_alter to disable the row weight fields (actually, that might also take care of the js as well).
_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.
awesome advice!
Thanks WorldFallz!
field_collection has done about 80% of the work I was going to have to do.
I had debated not asking the question and I would have gone in totally different direction. I appreciate the advice.
-------------
The main man of Set Sail's Daycare Management Software :)
_
glad to have helped ;-)
_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.
also, I just used CSS
also, I just used CSS {visibility:hidden;} to hide the handle for reordering the values themselves.
-------------
The main man of Set Sail's Daycare Management Software :)