wow. i just wasted 3 hours on this bug that wasn’t even a bug. it was prototype using a common language word (in this case, ‘request’) somehow internally so that I couldn’t use it as a POST parameter.

observe the following:

<script>
function submitIt()
{
  $('theform').submit({
    'onComplete':function()
    {
      alert('completed successfully');
    }
  });
}
</script>

<form id="theform" method="post" action="ajaxEngine.php">
  <input name="request" type="hidden" value="set_prefs" />
  <input name="username" type="text" />
  ... some more inputs here ...

  <!-- use formElement.request() to submit the form using ajax -->
  <input type="button" onclick=" submitIt(); " />
</form>

The seemingly innocuous <input name=”request” />, will, simply put,

fuck everything up

.

It was quite annoying for me. If prototype wants to use regular english words as reserved words, they should make like php and use something like __request, not a common word, like request, and further, not a common word that is likely to be used by a web programmer (request!!). jeez.

Post a Comment