replacing inline javascript with jquery

im relaxing the inline javascript by jquery.
I have attached two files one is having code with inline javascript.
The other file is having code with the jquery.

I want to verify if the query i have written is correct and would work as expected.
inline-javsacript-replaced-by-jquery
Inline-javascript
Newton21205Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Slick812Commented:
greetings Newton21205 , , , the code in your javascript is way too OLD, and out of date, as you have tests for things that in year 2017, that do not even exist any more -

        else if (navigator.appName=="Netscape"){
            NS6=parseInt(navigator.appVersion)>=5;
            NS4=4>=parseInt(navigator.appVersion);

these tests for "Netscape" are not valid, as "Netscape" no longer exists, , . .

In my view, Your best bet is to abandon that old javascript code, and start over with code that is more current, and corresponds to the HTML and Javascript standards used in browsers today.

Also, you can use non-Jquery, plain javascript to eliminate the "Inline" HTML javascript used.
0
Julian HansenCommented:
Also your code seems incomplete - as you have it it does not make sense. You have script that refers to checkboxes in MainForm but the checkboxes exist outside of any form - there is also "onlick" code wandering about by itself outside of an element.
0
Michel PlungjanIT ExpertCommented:
This is also not correct

$('#setform').on('onclick', function(){  

Open in new window


should be

$('#setform').on('click', function(){  

Open in new window


There is no need to prefix the javascript: label in handlers and you really should assign them unobtrusively using the jQuery you now want to use.

Like
$("[name='qrytype']").on("click",function() {
  $(".key").hide();
  $("#"+$(this).data("key")).show();
});

Open in new window

using

<input type="radio" name="qrytype" data-key="keystore".... />

and

<div class="key" id="keystore" ...>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Newton21205Author Commented:
done
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.