I have a couple of buttons in html as follows:

<tr>
<td><a href="member_archive_action.php"><input class="button" name="Change" type="button" id="Change" value="Change" ></a></td>
<td><a href="members.php"><input class="button" name="Back" type="button" id="Back" value="Back" ></a></td>
</tr>

Each of them calls the appropriate php script twice when pushed. The Change button toggles a flag so was apparently doing nothing. Very puzzling for a while.

This may not be a php problem but can any one assist please?

Further to the above post, it appears that the problem relates to the browser I am using, ie. Firefox. The buttons don't appear to work at all in IE. On average, I guess they work just fine.

on the buttons, add "onClick='return false;' which will negate the click event on the button but maintain the a href one.

Regards

Thanks amphetkid. Unfortunately, that stops the buttons working at all in Firefox. I think I will use some Javascript. It's a bit more complicated but I know I can make it work.

how about

<input type="button" onClick="window.location='member_archive_action.php';return false{);' value="xxxx">

that way you get away from having to wrap the button in an anchor tag as well.

regards

Thanks again amphetkid but that doesn't work either. I'll stick with js. Thanks

Sorry, couldn't solve it.

Strange because we use that code on our website and it works ... better go check :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.