Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: dynamically built form getting data parameters

by tangent (Vicar)
on Jun 10, 2016 at 15:50 UTC ( #1165306=note: print w/replies, xml ) Need Help??


in reply to Re^2: dynamically built form getting data parameters
in thread dynamically built form getting data parameters

The problem with multiple values in an array is that a checkbox field will not exist in the values sent by the form unless it is checked. In your example, if you kept the names the same and only one checkbox was ticked it would come in like this:
Professor => ["Doe, Jane","Smith, Josh"], IDNum => ["0116411160645","0116411162016"], Status => "KEEP THIS ITEM",
You have no way of telling which item this refers to. So you will need to group each item somehow, and I think your idea of incrementing is fine, as long as you do it to all parameters as hippo points out.

Replies are listed 'Best First'.
Re^4: dynamically built form getting data parameters
by hippo (Bishop) on Jun 10, 2016 at 15:59 UTC

    Excellent point. The easy alternative is to replace the checkboxes with selects which just have "Yes" and "No" as options. Not as clean from a UI point of view, though.

    Yet another option is to set the values of the checkboxes to a unique identifier like the IDNum (assuming it is unique) and that way you know which ones are to be kept.

    There's also the JS option, but I like that least of all.

    TIMTOWTDI!

Re^4: dynamically built form getting data parameters
by golroch (Initiate) on Jun 10, 2016 at 16:29 UTC
    Thanks everyone for the help and great information. The modules mentioned look promising, sadly they are not on installed on my system. Going to code it the long way as your right, I won't know which books have been checked.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1165306]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2022-05-25 19:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (90 votes). Check out past polls.

    Notices?