shadowfiend20 Posted September 11, 2009 Share Posted September 11, 2009 hi all wat i m trying here is to hide a div using two radio buttons with help of jqueryjquery..but this does'nt seem to b working..here is the fill code if this works probably i can use it in my php scrip..i m new to jquery so,,,,,,,,, <html> <body> <head> <script language="javascript"> $(document).ready(function() { $('#yes').click(function(){ $('#tab').show(); }); $('#no').click(function(){ $('#tab').hide(); }); }); </script> </head> <form> <input type="radio" value="no" name="rad1" id="no" >hide <input type="radio" value="yes" name="rad2" id="yes">show <div id="tab" style="display: block;">hello </div> </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/173875-solved-need-help-in-jquery-based-snippetwhich-i-ll-be-using-with-my-php-script/ Share on other sites More sharing options...
syed Posted September 11, 2009 Share Posted September 11, 2009 Firstly let me just say this is a PHP forum so if you want such non php related questions answered quickly, I would suggest posting on relevant sections. Now to try an answer your question, it appears to me that your radio buttons are working independently that is you can select them both, which is not the purpose of a radio button. What you need to do is give both the radio buttons the same name. This will allow you to select only one of the options. Link to comment https://forums.phpfreaks.com/topic/173875-solved-need-help-in-jquery-based-snippetwhich-i-ll-be-using-with-my-php-script/#findComment-916585 Share on other sites More sharing options...
shadowfiend20 Posted September 11, 2009 Author Share Posted September 11, 2009 oh well thanks a lot ..i was in little hurry so cudn't find the relevent section anyways dat problem is solved.. i hav downloaded the wrong jquery library so.. .. Link to comment https://forums.phpfreaks.com/topic/173875-solved-need-help-in-jquery-based-snippetwhich-i-ll-be-using-with-my-php-script/#findComment-916623 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.