spires Posted December 21, 2009 Share Posted December 21, 2009 Hi. I have a graphic that I want to use instead of a standard input button to submit a form. The image works in every browser except IE6 (maybe later versions also) Is there anyway around this? Thanks <input name="submit" type="image" src="images/forms/bt_free_quote.jpg" id="inputButton" value="submit" /> Link to comment https://forums.phpfreaks.com/topic/185888-graphic-instead-of-button/ Share on other sites More sharing options...
JonnoTheDev Posted December 21, 2009 Share Posted December 21, 2009 A button image doesn't use the name or value attributes. Should just be: <input type="image" src="/images/xyz.jpg" /> And thats it Link to comment https://forums.phpfreaks.com/topic/185888-graphic-instead-of-button/#findComment-981606 Share on other sites More sharing options...
spires Posted December 21, 2009 Author Share Posted December 21, 2009 OK, thanks for that. How can I then check to see if a form has been submitted using PHP? My Code: if (isset($_POST['submit'])){ } Thanks Link to comment https://forums.phpfreaks.com/topic/185888-graphic-instead-of-button/#findComment-981609 Share on other sites More sharing options...
spires Posted December 21, 2009 Author Share Posted December 21, 2009 Just worked it out thanks. I created a hidden input field in the form called submit. This posted with the form, so I could check to see if submit exists. Thanks for your help Link to comment https://forums.phpfreaks.com/topic/185888-graphic-instead-of-button/#findComment-981613 Share on other sites More sharing options...
haku Posted December 21, 2009 Share Posted December 21, 2009 <input type="button" src="path/to/image.jpg" name="submit" /> To check it: if(isset($_POST)) you can also check $_POST['submit_x'] or $_POST['submit_y'], but if the button has been clicked on with the enter key, neither of those will be filled in. Link to comment https://forums.phpfreaks.com/topic/185888-graphic-instead-of-button/#findComment-981663 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.