PDA

View Full Version : using an image to submit a form


Reeve of shinra
02-13-2003, 02:51 AM
How would I go about using images in place of the normal box here? I tried changing the type from submit to image added the img yadda yadda, but I cant seem to get it to work.

(original is below -- its from the journal hack)


<table align="center" border="0"><tr><td>
<form method="POST" action="journal.php"><input type="submit" name="addentrysubmit" value="Add Entry" style="background-color: {tableheadbgcolor}; color: {tableheadtextcolor}; font-weight: bold;"><input type="hidden" name="journalid" value="$journalid"><input type="hidden" name="userid" value="$journalid">
</form></td><td>
<form method="POST" action="journal.php">
&nbsp;&nbsp;<input type="submit" name="submit_view_all" value="View All Entries" style="background-color: {tableheadbgcolor}; color: {tableheadtextcolor}; font-weight: bold;"><input type="hidden" name="journalid" value="$journalid"><input type="hidden" name="userid" value="$journalid"><input type="hidden" name="action" value="view"></form>
</td></tr>
</table>

Erwin
02-13-2003, 04:03 AM
Do you mean instead of a submit button, to use an image?

Change:


<input type="submit" name="submit_view_all" value="View All Entries" style="background-color: #006633; color: #FFCC00; font-weight: bold;">


To this:


<input type="image" name="submit_view_all" value="View All Entries" src="http://www.yoursite.com/images/yourimage.gif" border="0" height="40" width="100" hspace="5" vspace="10" align="middle">


Change http://www.yoursite.com/images/yourimage.gif to the URL of your image. And change the height and width settings if you want to (or leave them out - they are optional).