Jump to content

Recommended Posts

I try to modify the background color when the usser clicks on a radiobutton, frankly nothing happens so far.

[code]
<form><br>
<input type="radio" name="bgcolor" onClick="document.bgcolor= class="Normal" checked>Normal</a><br>
<input type="radio" name="bgcolor" onClick="document.bgcolor= class="Light">Light</a><br>
<input type="radio" name="bgcolor" onClick="document.bgcolor= class="Dark">Dark</a><br>
</form>
[/code]

I put in the little CSS code which looks like this
[code]
<style type="text/css">
.dark {background-color: #335588};
.Light {background-color: #7799CC};
.Normal {background-color: #5577AA};
</style>
[/code]

ant suggestion why it doesn't work, cause I have seen it been done before
Link to comment
https://forums.phpfreaks.com/topic/15999-onclick/
Share on other sites

I got it working now with the following code

[code]<input type="radio" name="bgcolor" onClick="document.bgColor='5577AA'">Normal</a><br>
<input type="radio" name="bgcolor" onClick="document.bgColor='7799DD'">Light</a><br>
<input type="radio" name="bgcolor" onClick="document.bgColor='335588'">Dark</a><br>[/code]

But now would I like to save it so it keeps having that background through all pages as well, is that a possiblity?
Link to comment
https://forums.phpfreaks.com/topic/15999-onclick/#findComment-65792
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.