My theory lasted until QA told me it happened in Safari on the Mac too. Then I tried it in FireFox on Linux. Same deal. After simply submitting the form 3 times the browser became unusable and eventually crashed. So much for the IE sucks theory.
In this form, if the user doesn't make any edits then submitting the form should return them the exact same HTML. I decided that I wanted to make sure that was really the case. My co-worker, Peter Leonard, suggested I use HTTP::Proxy to monitor the connection between the browser and the server. I did and was able to log each successive response to a separate file. I then ran a diff of each response. The results showed the problem clearly. Where there should be a single hidden field I saw around 50 hidden fields concatenated together. On each request the list of hidden fields grew longer. The name on the hidden input tags was "name".
Eventually I found the problem code:
return scalar $query->hidden(name => $param, default => ($element->data() || ""), override => 1);
It looks like a call to the CGI::hidden method using named parameters, doesn't it? But CGI.pm requires named params to start with '-'! This call was being interpreted as a request to setup a hidden input called "name" and without the "-override" option that will pull in whatever CGI::param() has for "name"! Thus, each time the form is submitted the list of hidden fields grows. Eventually it grows so large that the browser can't handle it.
Three dashes later and the code was working again:
return scalar $query->hidden(-name => $param, -default => ($element->data() || ""), -override => 1);
-sam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Don't Blame The Browser
by FoxtrotUniform (Prior) on Jun 11, 2004 at 03:17 UTC | |
by drewbie (Chaplain) on Jun 11, 2004 at 04:44 UTC | |
by water (Deacon) on Jun 12, 2004 at 23:19 UTC | |
|
Re: Don't Blame The Browser
by exussum0 (Vicar) on Jun 11, 2004 at 00:59 UTC | |
by drewbie (Chaplain) on Jun 11, 2004 at 02:55 UTC | |
by samtregar (Abbot) on Jun 11, 2004 at 03:00 UTC | |
by drewbie (Chaplain) on Jun 11, 2004 at 03:08 UTC | |
by samtregar (Abbot) on Jun 11, 2004 at 05:22 UTC | |
by samtregar (Abbot) on Jun 11, 2004 at 02:58 UTC | |
|
Re: Don't Blame The Browser
by etcshadow (Priest) on Jun 10, 2004 at 23:01 UTC | |
|
Re: Don't Blame The Browser
by Anonymous Monk on Jun 11, 2004 at 01:25 UTC | |
|
Re: Don't Blame The Browser
by swngnmonk (Pilgrim) on Jun 11, 2004 at 16:07 UTC | |
|
Re: Don't Blame The Browser
by cosimo (Hermit) on Jun 11, 2004 at 11:42 UTC | |
|
Sometimes You Should Blame The Browser
by tilly (Archbishop) on Jun 11, 2004 at 20:39 UTC | |
|
Re: Don't Blame The Browser
by drewbie (Chaplain) on Jun 11, 2004 at 03:00 UTC |