This is a discussion on "CGI that lists and sorts form data??" within the Web Page Design section. This forum, and the thread "CGI that lists and sorts form data?? are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
CGI that lists and sorts form data??
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
CGI that lists and sorts form data??
I need a cgi script that when executed through a form adds the values inputed to a list (existing on the same page) and sorts them according to one of the form fields (date to be specific)
example: form with 3 fields a, b (date field) and c fill it out, press submit, and the three values show up right below (in text fields I suppose would be the only way to go, that's fine) repeat the process and there's another line added again with the newly inputed values in them here's the thing I don't know if I can make text fields show dynamicly with new lines of data submitted without refreshing the page (I could at very least use iframe and refresh that if that would be the only option) the twist here is that I want those lines of data to sort according to the date ("Aug 12 2005" format but I could have it as digits if sorting months by name is too complex) ...anyone seen a script like this anywhere? I'd appreciate it |
|
|
|
|||
|
The script is easy enough in Perl. I won't comment on the HTML portion except to say, I'd use an iframe.
To answer your question on the script, use an associative array to hold the month data. I'm sure there is even a simpler way if you research existing CPAN stuff but I would do the following as it is only 1 minute to type it up: %months=(); $months{'january'} = 1; $months{'february'} = 2; ... $months{'december'} = 12; or you could put the values as strings like "01"..."12"...depending on the type of sorting you use. Then in your sort function pass the form month string value as the key to the associative array (that will give you the numeric value): $months{$form_month} I hope this helps. |
|
|||
|
I appreciate your help,
Honestly I haven't worked with forms that much hence not much cgi/pearl experience either suppose I go with the iframe option, what has to be done on the target page side, one in the iframe, to make it work? or is it all handeled by the script? thanks |
![]() |
| Tags |
| cgi, lists, sorts, form, data |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sending Form Data to E-mail Address | Fools Gold | Starting Out | 4 | Dec 23rd, 2007 14:16 |
| Form creating record but not adding data | Andrew1986 | Databases | 22 | Oct 19th, 2007 08:47 |
| Form data to MySql | casper22 | Introduce Yourself | 4 | Aug 8th, 2006 21:30 |
| Working with Form 'file field' data in ASP. | daryl | Classic ASP | 3 | Jun 24th, 2006 20:22 |
| About sending form-data to an email address | a.jenery | Web Page Design | 4 | Mar 3rd, 2006 12:17 |