Changing a form's action attribute in IE?

Posted by Jonatan Littke on Stack Overflow See other posts from Stack Overflow or by Jonatan Littke
Published on 2010-04-13T16:21:24Z Indexed on 2010/04/13 16:23 UTC
Read the original article Hit count: 443

Hey.

I'm trying to set a hash value in a form's action, to keep it when the form is submitted.

Firefox allows me to update the hash and redirects accordingly, but IE doesn't. I initially thought this was related to IE not allowing hash values in the action attribute at all, but it seems I can't dynamically set the action at all in IE - with a hash or not? Is that right?

I'm using the following jQuery:

$("#options-form").attr('action', '#' + hash);

To update:

<form id="options-form" action="" method="get">

(On a sidenote, this wasn't needed in Firefox, because FF appears to preserve the current hash if it was only the GET params that changed.)

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript