Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 16-08-06
Northern Monkey's Avatar
Member
 
Join Date: Jan 2004
Location: UK
Posts: 142
Thanks: 0
Thanked 0 Times in 0 Posts
Northern Monkey is an unknown quantity at this point
  Form buttons

So here I am with a great functional website that looks like a dog.

I have 3 buttons in a form:

<input type="submit" name="submit" value="Edit">
<input type="submit" name="submit" value="Preview">
<input type="submit" name="submit" value="SendPreview">

When the form is submitted the page changes depending on the value of $_POST['submit']. Now I want the buttons to be nice flashy jpg's but I can't seem to get the values working! I have tried:

<input type="submit" name="submit" value="Edit" src="image.jpg"> - Doesn't work

<Button name="submit" style="color:#009 border:none background:#000 url('image.jpg') no-repeat"></button> - Nice picture but no value returned


Any ideas what I'm doing wrong?

NM.
__________________
Holiday Villa In<br>
<font size=2>If it moves, kick it. If it doesn't move, kick it till it moves and hen kick it because it moved</font>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 16-08-06
Ste's Avatar
Ste Ste is offline
It's a hard life .....
 
Join Date: Apr 2004
Location: Lancashire
Posts: 607
Thanks: 0
Thanked 0 Times in 0 Posts
Ste is an unknown quantity at this point
Change the input type="submit" to image in the tag so you are left with:

<name="submit" type="image" src="image.jpg">

which will work!
__________________
A World of Poker - Its the Nutz! www.aworldofpoker.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 16-08-06
Northern Monkey's Avatar
Member
 
Join Date: Jan 2004
Location: UK
Posts: 142
Thanks: 0
Thanked 0 Times in 0 Posts
Northern Monkey is an unknown quantity at this point
Have tried that little sucker before and it won't display the image. Also don't forget there are 3 buttons with the same name and you didn't have value="". So I assumed you missed it?

NM.
__________________
Holiday Villa In<br>
<font size=2>If it moves, kick it. If it doesn't move, kick it till it moves and hen kick it because it moved</font>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 16-08-06
Ste's Avatar
Ste Ste is offline
It's a hard life .....
 
Join Date: Apr 2004
Location: Lancashire
Posts: 607
Thanks: 0
Thanked 0 Times in 0 Posts
Ste is an unknown quantity at this point
<name="submit" type="image" src="image.jpg" value=”Edit”>

I did miss out the value and I presume you have replaced image.jpg with the actual path to the images you want as the buttons!

As it is just above standard code to use an image instead of a button.
__________________
A World of Poker - Its the Nutz! www.aworldofpoker.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #5 (permalink)  
Old 16-08-06
Northern Monkey's Avatar
Member
 
Join Date: Jan 2004
Location: UK
Posts: 142
Thanks: 0
Thanked 0 Times in 0 Posts
Northern Monkey is an unknown quantity at this point
Hi Ste,

Yep tried that and it doesn't show the image at all. Actual code I have is:

<name="submit" type="image" src="images/Edit.jpg" value="Edit">

The image exists and is available as I've tested the path with <IMG SRC="...">. Any other ideas. I'm running in IE using Apache as my server so all should be ok.

NM.
__________________
Holiday Villa In<br>
<font size=2>If it moves, kick it. If it doesn't move, kick it till it moves and hen kick it because it moved</font>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 16-08-06
drivetowin's Avatar
Driving to win
 
Join Date: Aug 2003
Location: If I'm not at home, I'm in hospital
Posts: 7,363
Thanks: 5
Thanked 8 Times in 5 Posts
drivetowin seems to know their stuff
I don't think you can set value for an image field in a form - if you want to have three buttons and pass a value you have to use the default form buttons (afaik)
__________________
Never argue with idiots. They just drag you down to their level and then beat you with their experience.

If ignorance is bliss then some of the people I know must be orgasmic.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 16-08-06
Northern Monkey's Avatar
Member
 
Join Date: Jan 2004
Location: UK
Posts: 142
Thanks: 0
Thanked 0 Times in 0 Posts
Northern Monkey is an unknown quantity at this point
Damn just found the answer in an old post I did. Here's the solution (thanks to Top Hat and Morley Mouse for original answers):

First create the button like Ste said:

<input type="image" name="submit" src="./images/Edit.jpg">

When the form is submitted the value of submit will be empty but submit_x and submit_y will be populated with where in the button you clicked so I changed the code to this:

<input type="image" name="Sub_Edit" src="./images/Edit.jpg">
<input type="image" name="Sub_Preview" src="./images/Preview.jpg">
<input type="image" name="Sub_Send" src="./images/Send.jpg">

Then at the start of the form I did:

if (isset($_POST['Sub_Edit_x) OR isset($_POST['Sub_Preview_x) OR isset($_POST['Sub_Send_x)) {
Then check which one is set and respond
}
__________________
Holiday Villa In<br>
<font size=2>If it moves, kick it. If it doesn't move, kick it till it moves and hen kick it because it moved</font>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
VAT Registration Form - Bit Of Help Please? KirstyM Growing Your Business, VAT, TAX and Development 16 23-06-06 01:45 PM
PHP Form Help MobileDealsNow Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 3 13-11-05 06:22 PM
Buttons, bloomin buttons! Northern Monkey Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 5 31-03-05 02:19 PM
Lost password form on CJ website woutermols Commission Junction - CJ UK 0 30-03-05 06:18 PM
New Merchant - Chocolate Buttons rufus Affiliate Future 5 05-07-04 02:11 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7