Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 83719
Status: rejected
Priority: 0/
Queue: CGI

Owner: Nobody in particular
Requestors: konop039 [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Subject: hidden() does not assign the given value to the named element
Date: Fri, 1 Mar 2013 14:51:36 -0600
To: bug-CGI [...]
From: Dmitry Konopatski <konop039 [...]>
Download (untitled) / with headers
text/plain 1.2k
#!/usr/bin/perl # bug-CGI [at] =pod Hi, Using the following scenario I am trying to create a hidden input "weather" with an explicitly assigned value of "exciting". The problem is that my input will be assigned a different value of "dull" which comes in the body of the HTTP request. I have not had a chance to come up with a patch, but I am sending you a test script that would allow you to reproduce the issue for the recent versions of Thanks, Dmitry Konopatski =cut BEGIN { use strict; use warnings; use lib qw(lib ../lib); use Test::More; } use CGI; my ($name, $val, $newval) = ("weather", "dull", "exciting"); my $q = CGI->new("$name=$val"); ok(($a = $q->hidden($name, $newval)) !~ /\Q$newval\E/i, $a); ok(($a = $q->hidden($name, $newval)) =~ /\Q$val\E/i, $a); ok(($b = $q->hidden(-name => $name, -default => $newval)) !~ /\Q$newval\E/i, $b); ok(($b = $q->hidden(-name => $name, -default => $newval)) =~ /\Q$val\E/i, $b); ok($a eq $b, "HTML is the same"); ok(($a = $q->hidden(-name => $name, -default => $q->param("weather", $newval))) =~ /\Q$newval\E/i, "Workaround 1"); ok(($b = $q->input({type => "hidden", name => $name, value => $newval})) =~ /\Q$newval\E/i, "Workaround 2"); done_testing();
Subject: Re: [ #83719] hidden() does not assign the given value to the named element
Date: Thu, 07 Mar 2013 16:39:26 -0500
To: bug-cgi [...]
From: Mark Stosberg <mark [...]>
Download (untitled) / with headers
text/plain 144b
You've run into the documented "sticky" behavior. See -nosticky in the docs for more detail about the feature and how to disable it. Mark

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to