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" /> Quote Link to comment 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.... Quote Link to comment 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... Quote Link to comment 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"> Quote Link to comment 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.. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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.