No, they are built in.
Okay, lets dissect what each bit is doing, and then maybe we can see why it's not working
Code:
<script type=text/javascript src = 'jq.js'>
How come your script tag has a source and a content? That doesn't seem right. Also where is your tag? Is it at the bottom of the page, after the table with the buttons? If not you need to tell jquery not to execute it till after the page has loaded, like this
Code:
<script type=text/javascript>
$(document).ready(function() {
$('radio[name="gallery"]').click(function() {
$(this).parent().child('input[name^="price"]').hide();
$(this).parent().child('input[name^="reciver"]').hide();
$(this).parent().child('input[name^=gallery"]').show();
});
$('radio[name="send"]').click(function() {
$(this).parent().child('input[name^="price"]').hide();
$(this).parent().child('input[name^="reciver"]').show();
$(this).parent().child('input[name^="gallery"]').hide();
});
$('radio[name="send"]').click(function() {
$(this).parent().child('input[name^="price"]').hide();
$(this).parent().child('input[name^="reciver"]').hide();
$(this).parent().child('input[name^="gallery"]').show();
});
});
</script>
Okay lets assume you have done that, so now we analyse the actual body of the script. What this does is identify some element on the page and thne attach an action to it that happens when you click it (with click()). So ...
Code:
$('radio[name="gallery"]').click(function() {
Means, find all radio buttons on the page whose name is 'gallery', and do something when they are clicked. Then
Code:
$(this).parent().child('input[name^="price"]').hide();
Means, find that button (identified as (this)), then find it's parent (the td), then find anything else in that td that is an input with a name starting with 'price' and hide it. If you want to imagine, each step in this (separated by a . ) is traversing up and down the tree of elements on the page till you find one you want to do something to. You can read this as
[pre]start with this -> go up to it's parent -> go down to it's children -> find the ones which are inputs with names starting with price -> hide them[/pre]
I hope that makes some sense!
Bookmarks