damdempsel Posted November 3, 2009 Share Posted November 3, 2009 Is there a way to make a input box have an image? I know you can do it with submit buttons but I can't seem to find anything with text boxes. I guess it doesn't need to be an image as much as a color. Anyone know how? Here is a code I found for the submit button: <form name="form1" action="target_file.php" method="GET or POST"> //Your form fields //Here is the submit button <a href="java script:document.form1.submit();" title="Submit the Form"><img src="image.png" onmouseover="this.src='image2.png';" onmouseout="this.src='image.png';" border="0"></a> </form> Quote Link to comment https://forums.phpfreaks.com/topic/180039-solved-text-box-image/ Share on other sites More sharing options...
marcus Posted November 3, 2009 Share Posted November 3, 2009 You can use: <input type="image" src="urlpic.gif" name="submit"> Quote Link to comment https://forums.phpfreaks.com/topic/180039-solved-text-box-image/#findComment-949850 Share on other sites More sharing options...
damdempsel Posted November 3, 2009 Author Share Posted November 3, 2009 But is there a way to do it with a text box? When I say text box I am talking about this: <input type="text" name="whatever"> Quote Link to comment https://forums.phpfreaks.com/topic/180039-solved-text-box-image/#findComment-949866 Share on other sites More sharing options...
marcus Posted November 3, 2009 Share Posted November 3, 2009 You could set a background image to it <input type="text" style="background-image:url('xxx.gif');border:0px;"> Quote Link to comment https://forums.phpfreaks.com/topic/180039-solved-text-box-image/#findComment-949867 Share on other sites More sharing options...
mikesta707 Posted November 3, 2009 Share Posted November 3, 2009 if you want to make a text box a certain color, you can use CSS, IE <input type="text" style="background-color:#000000" ...etc /> that would make the background color black. Obviously, you could set the background-image attribute, as well as any other attribute you wanted. BTW this is a CSS problem, not really a PHP problem Quote Link to comment https://forums.phpfreaks.com/topic/180039-solved-text-box-image/#findComment-949868 Share on other sites More sharing options...
damdempsel Posted November 3, 2009 Author Share Posted November 3, 2009 Thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/180039-solved-text-box-image/#findComment-949871 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.