Weirfire
Dec 17th 2008, 1:58 pm
I have a hyperlink submit button inside one of my forms. This button is for a simple message system.
<a href="#" onclick='document.getElementById("mailboxaction").value="read";document.forms["checkboxes"].submit();'>Read</a>
This piece of code works perfectly in Internet Explorer but it won't even post the form in Firefox.
I have tried setting the last piece of code that submits the form to "this.form.submit();" but neither work in Firefox.
If anyone wants to try this on your own system then you can use the form below;
<form action='' method='POST' name='checkboxes' id='checkboxes'>
<input type='hidden' name='test_field' value='test field' />
<input type='hidden' name='mailboxaction' value='' />
</form>
and stick this
var_dump($_POST);
at the top of the page to see the result of the post.
If anyone has any ideas or solutions as to why this doesn't work in Firefox I would be forever grateful.
So the full page of code should look something like;
var_dump($_POST);
<form action='' method='POST' name='checkboxes' id='checkboxes'>
<a href="#" onclick='document.getElementById("mailboxaction").value="read";document.forms["checkboxes"].submit();'>Read</a>
<input type='hidden' name='test_field' value='test field' />
<input type='hidden' name='mailboxaction' value='' />
</form>
Thanks for taking a look! :D
<a href="#" onclick='document.getElementById("mailboxaction").value="read";document.forms["checkboxes"].submit();'>Read</a>
This piece of code works perfectly in Internet Explorer but it won't even post the form in Firefox.
I have tried setting the last piece of code that submits the form to "this.form.submit();" but neither work in Firefox.
If anyone wants to try this on your own system then you can use the form below;
<form action='' method='POST' name='checkboxes' id='checkboxes'>
<input type='hidden' name='test_field' value='test field' />
<input type='hidden' name='mailboxaction' value='' />
</form>
and stick this
var_dump($_POST);
at the top of the page to see the result of the post.
If anyone has any ideas or solutions as to why this doesn't work in Firefox I would be forever grateful.
So the full page of code should look something like;
var_dump($_POST);
<form action='' method='POST' name='checkboxes' id='checkboxes'>
<a href="#" onclick='document.getElementById("mailboxaction").value="read";document.forms["checkboxes"].submit();'>Read</a>
<input type='hidden' name='test_field' value='test field' />
<input type='hidden' name='mailboxaction' value='' />
</form>
Thanks for taking a look! :D