On Thu, 14 Feb 2002, GsuLinuX wrote: > It worked on normal submit buttons but problem on image submit button. > > I couldn't manage to work it with > image submit buttons. Fot example if their 2 image submit buttons as : > > <input type="image" border="0" name="button3" value="This is button 3" > src="c:\windows\desktop\house.gif" width="100" height="50"><br><br><br> > <input type="image" border="0" name="button4" value="This is button 4" > src="c:\windows\desktop\debugreport.jpg" width="100" height="50"> > > cgi cannot get the names of these? Must i use other module?
The problem with image buttons is that they return name.x and name.y (with the corrdinates of where they were clicked) to your CGI script, so you will need to find out which image was clicked that way. You could do something like (using CGI.pm): use CGI; my $q = new CGI; my %params = $q->Vars(); #put all params into hash my $button; foreach(keys %params) { if(/(.*)\.x) { $button = $1; } } -- Brett http://www.chapelperilous.net/ ------------------------------------------------------------------------ QOTD: If you're looking for trouble, I can offer you a wide selection. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]