takeshin,
You can use a javascript timer to disable the submit button after 1 ms, that
way the value is submitted with the form while still preventing
double-submits:
$form->setAttrib('onsubmit', "window.setTimeout(function()
{document.getElementById('$id').disabled =
1;}, 1)");
Or, better yet, disable form submission altogether (since most browsers
allow you to submit a form by pressing [Enter] when a text input is
focused).
$form->setAttrib('onsubmit', "if (this.isSubmitted) { return false; } else {
this.isSubmitted = true; }");
--
Hector
On Thu, Jan 28, 2010 at 8:38 AM, takeshin <[email protected]> wrote:
>
> This would work,
> but I use onsubmit attribute,
> to disable the submit button,
> to prevent double submit:
>
> $form->setAttrib('onsubmit', "document.getElementById('$id').disabled =
> 1;");
>
> So the submit is not in the $_POST
>
> --
> regards
> takeshin
> --
> View this message in context:
> http://n4.nabble.com/Which-Zend-Form-was-submitted-tp1371563p1386736.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>