image button as a submit button

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Anant
Forum Commoner
Posts: 66
Joined: Wed Jul 14, 2010 11:46 am

image button as a submit button

Post by Anant »

Hi Devs,

I am trying to place image button in the form and want it to act as a submit button.

After bit of googling - i found out if i add value to the image button it will act as a submit button -

Code: Select all

<input name="Submit" type="image" src="../../abc.gif" width="70" height="25" value="Submit" />
But this is obviously not working - is there something am doing wrong ??

Any help would be greatly appreciated.

Thank You.
oscardog
Forum Contributor
Posts: 245
Joined: Thu Oct 23, 2008 4:43 pm

Re: image button as a submit button

Post by oscardog »

Fairly sure that by adding the value 'submit' to the button it wont make it suddenly work (You might want to try submit, no capitalisation though).

But another way around it would be to use javascript:

Code: Select all

<input name="Submit" type="image" src="../../abc.gif" width="70" height="25" value="Submit" onclick="this.submit()" />
shawngoldw
Forum Contributor
Posts: 212
Joined: Mon Apr 05, 2010 3:38 pm

Re: image button as a submit button

Post by shawngoldw »

You're right, adding value won't make it magically work but you really don't need javascript to make it work...

Can you paste your entire form Anant?
Post Reply