Solved

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

Posted on 2008-10-05
3
1,949 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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert Silverlight ERP To Angularjs,HTML5 3 56
Powershell GUI 11 56
PowerShell and cisco ios 3 40
Making Table Thru ASP Response.write 5 19
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

685 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