Wednesday, October 29, 2008

Invalid Parameter Submit.x in HTTP Post

I thought I'd done the code wrong though I was really wondering how it could go wrong with just some keys and values for my HTTP post. Usually, you'll just put the following code for your simple HTTP post, right?

< form method="post" action="(wherever you want to post this form to)" >

Upon posting, if you have images within the form, there will be additional parameters for its x and y positions. Thus if you're posting to a page which is strict with the parameters, you'll end up with an "invalid parameter" error or the like.

Just add an onsubmit attribute in your form tag to clean up the x and y parameters, like so:

< form method="post" action="(wherever you want to post this form to)" onsubmit="this.submit();return false;">

Thanks to webmasterworld for this info.

No comments:

Your Ad Here