Solved

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

Posted on 2008-10-05
3
1,931 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
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
Badotz earned 500 total points
Comment Utility
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
Comment Utility
That one and also using the onclick solved the problem.Thanks
0
 
LVL 29

Expert Comment

by:Badotz
Comment Utility
No worries - glad to help.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now