What sort of file handler are you using on your server to “catch”
these? There’s a way to do this in either Ruby or PHP, where you name
the fields with a trailing square-bracket block, like this:
<input name="lastname[]">
What happens when you do that is you can have more than one field with
the same name. The multiple fields are sent to the server as an array:
lastname = array(
0 => 'Smith',
1 => 'Jones'
}
And if you have say ten firstname[] and ten lastname[] fields in the
same form, in the same source order, the arrays will be aligned so you
can pluck out firstname[1] + lastname[1] and plop them in the same
database row.
So to add more of these to your page, you would create a JavaScript
function to insert more of them as needed, using a click for more link
or icon. I’d use Prototype for this, using my Protaculous Action.
You’ll need some sort of structure to your page, at least a DIV with a
paragraph per row, or a table, or a list. There just has to be some
framework you can hang things off of. Your add-more link needs to have
an ID attached to it, so you can find it in the DOM later.
So if your page looks like this:
You could add 5 more rows with the following JavaScript pasted into
the top Function Body dialog in Protaculous.
You’ll have to check the way you lay out your page, and make any
necessary changes to your script to match how you have positioned the
fields.
As far as catching these on the server, it’s just a matter of looping
through each of these fields, checking to see if all the parts are
there, and making a new entry in the database if they are.
Walter
On Sep 20, 2010, at 2:41 PM, Ginjg wrote:
Is this doable? I want to build a form that allows people to submit
a list of names for alphabetical entry into a master db.I know how to do the basic part for the personal info and the
donation payment.
It’s collecting the list in a manageable way that’s throwing me.
Currently they’re just putting them in a text box, but few follow
the instructions, so it’s taking a lot of time to get the names
rearranged to be sorted.I’d like the add to master list portion to have 3 - 5 rows of 3
fields to start, and an “add more” button that would give another
set of rows ( some people have 15 - 20 names at a time) and of
course a submit button that sends the names to the masterlist db and
takes the user to the payment interfacethe 3 fields are lastname, firstname, pronunciation
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options