Comma in a Form post action attribute

I have a client that has provided a form that submits to a script on another website, and has asked me to include it on their wordpress site.

The problem is, that even though the form works fine on a vanilla HTML page, once placed into a wordpress template it bounces back on itself (you see the address bar in the browser change briefly to the other website but then changes back after a second).

I’ve copied below a semblance of the form (although I’ve changed it a bit to protect my client’s data):

<!–Form–>
<form method=”post” action=”https://www.example.com/myLogin,myLoginForm.gdirect” id=”myLoginForm”>
<div style=”display:none;” id=”loginFormhidden”>
<input type=”hidden” name=”myformids” value=”If_3,If_4,username,password,loginButton,If_5″ />
<input type=”hidden” name=”seedids” value=”” />
<input type=”hidden” name=”submitmode” value=”” />
<input type=”hidden” name=”submitname” value=”” />
<input type=”hidden” name=”If_3″ value=”E” />
<input type=”hidden” name=”If_4″ value=”E” />
<input type=”hidden” name=”If_5″ value=”E” />
</div>

<table class=”mypmform”>
<tr><td><input type=”text” name=”username” value=”” id=”username” size=”20″ placeholder=”Username” /></td></tr>
<tr><td><input type=”password” name=”password” value=”” id=”password” size=”20″ placeholder=”Password” /></td></tr>
</table>
<input type=”submit” class=”button black” value=”Login” />
</form>

If I change the comma in: https://www.example.com/myLogin,myLoginForm.gdirect to a dot or slash, eg. https://www.example.com/myLogin.myLoginForm.gdirect, the page does direct to www.example.com, but creates an error.

My question is, why does wordpress not accept the post action url value with a comma in it? Like I said it works fine on vanilla HTML page, and the page will forward on without the comma, but the page it goes to throws an error.

Does anyone know a way around this?

I’m thinking that there’s something in WordPress that’s rejecting the comma when used in the url value of the action attribute, since if it’s placed directly on the page: Site url, then it does go there, but obviously it’s not carry over the form values so doesn’t work.

Thanks for any insight into this!

Read more here:: Comma in a Form post action attribute

Leave a Reply

Your email address will not be published. Required fields are marked *