Solved

JS onchange() /onclick() event in Radio button in IE7/6 does not give the desired result

Posted on 2008-10-05
3
1,953 Views
Last Modified: 2013-11-19
Hello I am facing a werid JS issue on IE (works on Firefox ).The onchange() event for a Radio button works weirdly for IE where the value is not shown in the first time of onchange() .and the oder is all messed up.

<div id="reservation">
            <p><b>Reservations</b></p>
                    <label><input id="reservation-hourly" onclick="reservationype();" type="radio" name="reservation_type" value="ac"/> AC</label>
                <label><input id="reservation-structured" onclick="reservationType();" type="radio" name="reservation_type" value="nonac"/> Non-AC</label>
           
</div>



function reservationype(){
    var value_type = $('#reservation input[type=radio][name=reservation_type]:checked').val();
    if(value_type == 'ac'){
        $('#ac').show();
        $('#non-ac').hide();
    }
 else if (value_type == 'nonac'){
        $('#non-ac').show();
        $('#ac').hide();
    }
}
0
Comment
Question by:micro_learner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
Badotz earned 500 total points
ID: 22644215
One of these things is not like the other:

onclick="reservationype();
onclick="reservationType();

Looks like you dotted all the "eyes", but missed crossing a "tee" ;-)
0
 

Author Closing Comment

by:micro_learner
ID: 31503159
That one and also using the onclick solved the problem.Thanks
0
 
LVL 29

Expert Comment

by:Badotz
ID: 22644278
No worries - glad to help.
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Building JSON/JQuery Results Display 11 52
Javascript: Range object 16 33
Set a parameter in a properties file and use in html table. 14 58
Dropdown animation to normal dropdown 6 28
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question