DeathStar Posted February 6, 2007 Share Posted February 6, 2007 've seen this many times before and just want to know how. i have an text box i want to let the backgorund color changeed when you click in the text box. how can i do this? here is my current code thats not working.. <input name="passwd1" type="text" onclick="background-color:#ffffff" maxlength="12" border="0" style="background-color:#333333" /> Link to comment https://forums.phpfreaks.com/topic/37274-solved-onclick/ Share on other sites More sharing options...
only one Posted February 6, 2007 Share Posted February 6, 2007 that would be more javascript than php.... Link to comment https://forums.phpfreaks.com/topic/37274-solved-onclick/#findComment-178068 Share on other sites More sharing options...
ToonMariner Posted February 6, 2007 Share Posted February 6, 2007 you need to use javascript to change the background colour - you can't just put style porperties in there... Link to comment https://forums.phpfreaks.com/topic/37274-solved-onclick/#findComment-178069 Share on other sites More sharing options...
only one Posted February 6, 2007 Share Posted February 6, 2007 or you could make a form, then echo "<body bg-color=$bgcolor"> Link to comment https://forums.phpfreaks.com/topic/37274-solved-onclick/#findComment-178070 Share on other sites More sharing options...
DeathStar Posted February 6, 2007 Author Share Posted February 6, 2007 I have made something in just php to change the background of the document. <a href="" onclick="document.bgColor='#333333'">Dark Gray</a> also with an onclick .. I need it in php though to maximize compatibility.. Link to comment https://forums.phpfreaks.com/topic/37274-solved-onclick/#findComment-178074 Share on other sites More sharing options...
DeathStar Posted February 6, 2007 Author Share Posted February 6, 2007 ok whats the code for doing it in js then? or what should i search for? Link to comment https://forums.phpfreaks.com/topic/37274-solved-onclick/#findComment-178082 Share on other sites More sharing options...
JasonLewis Posted February 6, 2007 Share Posted February 6, 2007 go post in the javascript board of phpfreaks. its around here somewhere. Link to comment https://forums.phpfreaks.com/topic/37274-solved-onclick/#findComment-178104 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.