Even if the user selects something valid from the drop down menu he is getting the backward error.....on every selection he makes.my @files = glob "$ENV{'DOCUMENT_ROOT'}/data/text/*.txt"; my @display_files = map m{([^/]+)\.txt}, @files; Encode::from_to($_, 'ISO-8859-7', 'utf8') for @display_files; if ( param('select') ) { #If User selected an item from the drop do +wn menu unless ( grep { $_ eq param('select') } @display_files ) #If User Selection doesn't match one of the passages then its a F +raud! { ...
In order to get into the error-report block, it must be the case that the string coming from the drop-down menu does not match any of the file name strings you have extracted from your "data/text" directory.
You didn't show us the code that creates the drop-down menu, and it looks like you haven't tried yet to look at the actual string value that is coming in via the "select" param. You need to see what sort of value is coming in, and then figure out why the values in the drop-down menu don't match the file names in that directory.
You should be using exactly one array to populate the options in the drop-down menu and to check the value of param('select'). Create that list only once, and use the one list for both building the form and checking the submission.
(updated to fix grammar in last paragraph)
Another update: if I understand this part correctly:
i noticed on the url that when i submit my selection it looks like this:
http://nikos.no-ip.org/cgi-bin/index.pl?select=item_from_drop_down_menu&ok=ok
I'm guessing the code that creates the drop-down menu is doing something very wrong. But you haven't shown that part of the code, so it's just a guess.
In reply to Re: somethign wrong with the sumbit
by graff
in thread somethign wrong with the sumbit
by Nik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |