We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,680 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Php - change Submit button to Image

this is weird, I have form and on this form three file uploads
and submit button, when i change the button to image (so it looks better than this old thing on my website) it does not upload the files

The button however works 100%, am i missing something here?

<form name="newad" method="post" enctype="multipart/form-data"  action="">
<table> 	
<tr>
<td height="120"><p>
  <input type="file" name="image1">
</p>
  <p>
    <input type="file" name="image2">
  </p>
  <p>
    <input type="file" name="image3">
</p></td>
</tr> 	
<tr>
  <td><input name="Submit" type="image" value="Upload image"  src="images/button_sub2.png"></td>
</tr>
<tr>
<td><input name="Submit" type="submit" value="Upload image"></td>
</tr> 
</table>	 
</form>

i dont want to use the normal button, i already did the website in iamge buttons, why does it not work though ?

5
Contributors
7
Replies
1 Year
Discussion Span
9 Months Ago
Last Updated
12
Views
branding4you
Junior Poster in Training
75 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

You want this:

<input type="image" src="blah.png">
edwinhermann
Junior Poster
142 posts since Sep 2009
Reputation Points: 67
Solved Threads: 29
Skill Endorsements: 2

You want this:

<input type="image" src="blah.png">

look at line 15 in my code , it is there already, does not work though

<td><input name="Submit" type="image" value="Upload image"  src="images/button_sub2.png"></td>
branding4you
Junior Poster in Training
75 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
<button type="submit" name="button1" value=" ">
<img src="images/button_sub2.png" width="32" height="32" alt="submit" border="0" />
</button>

or style the submit button

input[type=submit] { background:url('input.gif'); }
input:hover[type=submit] { background:url('input.gif') green; }
almostbob
Nearly a Senior Poster
3,303 posts since Jan 2009
Reputation Points: 585
Solved Threads: 403
Skill Endorsements: 7

look at line 15 in my code , it is there already, does not work though

<td><input name="Submit" type="image" value="Upload image"  src="images/button_sub2.png"></td>

That is indeed odd.
Can you browse to http://yourwebsite/images/button_sub2.png and see the image that way? Also try removing value="Upload image"

edwinhermann
Junior Poster
142 posts since Sep 2009
Reputation Points: 67
Solved Threads: 29
Skill Endorsements: 2

In which browser you are checking?

navi17
Junior Poster
120 posts since Oct 2007
Reputation Points: 15
Solved Threads: 6
Skill Endorsements: 0

IE .. i know it has issues and image buttons dont work for $_POST

It is to upload images to server, then store names in Mysql, that all works fine but the button looks like we stuck in the 80's ...lol
Wanted to use one that doesnt stick out like it doesnt belong there, so i did this as temp solution

<input name="Submit" type="submit" value="Submit" style="font-family:Stylus BT; font-size:medium;
font-style:bold; text-align:left; background:#000; border:0; color:#fff; width:5em" />

some of the code like BOLD in there does nothing so im messing around, it looks exactly like the image buttons i have though.

branding4you
Junior Poster in Training
75 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

you can set the background of the button using a little css

<input type="submit" style="background-image: url(images/button_sub2.png);" />
ab_omid
Newbie Poster
5 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.1053 seconds using 2.71MB