Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Greetings, Fellow Monks.

For a recent project, users are encouraged to fill in a form with a varying number of fields - all of the fields have the same basic premise(being an answer to a question), but need to have some sort of way for me to retrieve all of them using CGI.pm. Users are able to dynamically add fields(which would also mean dynamically naming them), up to a possible limit of infinity or so. I know that I could name the fields 'answer<foo>', where <foo> is a number from 1..infinity and then just retrieve all of them, but I'm wondering: is there a better way that I can organize and retrieve these values? In my mind I'm thinking of an array of some sorts, but I'm not sure if that's actually possible.



Thanks,
Spidy


Edited Addendum: I am absolutely not going to use Javascript or Ajax to do this, as this feature is being developed for users that do not have Javascript disabled. Also, a PHP version of what I'm talking about can be seen here, if you look under "Creating a PHP array in an HTML form".

In reply to Organizing Form Input by Spidy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-19 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found