Is it possible to achieve this using a button, instead of an image simulating the button?

<a href="new.php?id=<?php echo $id ?>"><img src="images/edit.gif" alt="" /></a>

My buttons use CSS to format them, and it would be a lot easier to use a button instead of having to edit the graphic for each button (plus the link isn't displayed quite right).

Is there a way I can do the above link in an onclick event?

    retro wrote:

    Is there a way I can do the above link in an onclick event?

    Well, yeah... the PHP code wouldn't change at all, you'd just change the HTML.

      I managed to work it out. Was a silly error on my part. Ended up with:

      <input type="button" name="edit" value="Edit" class="button" onclick="window.location.href='new.php?id=<?php echo $id ?>'" />

      Thanks!

        Write a Reply...