If you want to learn you need to put a teeny bit effort in yourself.
:P
1. Go to Google.
2. Enter "jquery".
3. Press enter, or click search.
4. Select the top result.
5. Select the Tutorials link.
6. Locate and click "Getting Started with jQuery".
7. Read it.
Because I'm nice, I'll save you some work and give you the link:
http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
I'm not doing #7 for you though!
For some encouragement, here's your current script block translated:
HTML code:
<script src="jquery.js"></script>
<script type="text/javascript">
function calcUS()
{
var f2 = $('[name=Check3]').is(':checked')
var rad_val = $('[name=Grp1]:selected').val()
$('[name=JBTest]').val( rad_val )
$('[name=F2Test]').val( f2 )
}
</script>
You might look at that now and go
"Huh?", but read the tutorial and hopefully that'll then turn into an
"Ah!" because that's fairly simple stuff.
I'm sure you can already see that it's almost half as much code - could even do it in just two lines if you wanted to skip the variables.
quote:
assuming I have lots of these checkboxes for additional options, is there a way to get the row to be highlighted when I select the checkbox?
Yes, but again it's much simpler with jQuery:
code:
$(this).parent('tr').css('background','red')
Would probably do it based on your current setup (might have that slightly off - I normally do things a bit differently.)
Doing it without jQuery, you'd need some code just after the "var rad_val ..." line to locate the parent tr and set its style attribute - I haven't bothered remembering how to do that sort of stuff, since I don't need to.
It might seem I'm going on about jQuery a lot, but ask anyone here that writes JavaScript and they'll agree that the days before the JS libraries came around, it was a horrible and painful experience as soon as you go beyond the basics.
With any JS library it takes away almost all the nasty stuff, and makes the simple stuff simpler too, so it really is worth investing some time in learning one.
(And jQuery is the library that more than 50% of people choose, so is a good starting point.)