Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9122117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:01:13+00:00 2026-06-17T06:01:13+00:00

This works just fine to call an OnChange event: <FORM> <SELECT ONCHANGE=alert(this.name + ‘

  • 0

This works just fine to call an OnChange event:

<FORM>
<SELECT ONCHANGE="alert(this.name + ' changed: ' + this.value)">
<OPTION VALUE="1">Option 1</OPTION>
<OPTION VALUE="2">Option 2</OPTION>
<OPTION VALUE="3">Option 3</OPTION>
</SELECT>
</FORM>

But when I use this styling package:

https://web.archive.org/web/20161013011416/http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/

The OnChange event no longer works.

<FORM>
<SELECT class="styled" ONCHANGE="alert(this.name + ' changed: ' + this.value)">
<OPTION VALUE="1">Option 1</OPTION>
<OPTION VALUE="2">Option 2</OPTION>
<OPTION VALUE="3">Option 3</OPTION>
</SELECT>
</FORM>

Anyway to make the OnChange event with the custom-form-elements.js?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:01:14+00:00Added an answer on June 17, 2026 at 6:01 am

    The answer is on the page you linked to 😉

    Scroll to the bottom and you will read:

    onChange and other JavaScript events

    This script utilizes JavaScript’s onChange and other events. Because
    these events can only be used once, if you want to add more functions
    to an event, you will need to call them from inside my script.

    ::EDIT::

    The Custom.clear and Custom.choose functions are both functions that will be called in the onChange event. So my guess is you modify the js-file as follows, and see what comes out:

    clear: function() {
        // add your code here. example:
        alert(this.name + ' changed: ' + this.value);
    
        inputs = document.getElementsByTagName("input");
        for(var b = 0; b < inputs.length; b++) {
            if(inputs[b].type == "checkbox" && inputs[b].checked == true && inputs[b].className == "styled") {
                inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
            } else if(inputs[b].type == "checkbox" && inputs[b].className == "styled") {
                inputs[b].previousSibling.style.backgroundPosition = "0 0";
            } else if(inputs[b].type == "radio" && inputs[b].checked == true && inputs[b].className == "styled") {
                inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
            } else if(inputs[b].type == "radio" && inputs[b].className == "styled") {
                inputs[b].previousSibling.style.backgroundPosition = "0 0";
            }
        }
    },
    choose: function() {
        // add your code here. example:
        alert(this.name + ' changed: ' + this.value);
    
        option = this.getElementsByTagName("option");
        for(d = 0; d < option.length; d++) {
            if(option[d].selected == true) {
                document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue;
            }
        }
    }
    

    Note: instead of writing chunks of code in the js-file, you should just call you own custom function once from the clear and/or choose function(s).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a problem where firefox works just fine, while chrome has the problem.
This aspect of my login system works just fine if I have the return
I have a Firefox 3.6.2 problem (3.5.x works just fine). This is the code:
I want to port this SQL query, which works just fine on SQL Server,
I've got a problem with this embed in Safari. It works just fine on
I'm using this function: preg_match_all('/((\d{9})\.html)/s', $content, $results); It works fine but i just want
In plain Ruby, this works just fine: class TestSuper def foo puts In TestSuper.foo
this code in my plugin used to work just fine: jQuery('#embedded_obj', context).get(0).getVersion(); and the
when I run this JS in FF or Safari it works just right but
I am trying to create this tooltip sample for my wordpress it works just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.