Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2008-10-05
3
Medium Priority
?
1,971 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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

636 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