Jquery Radio button not showing selected div

Commodorrenite

New Member
I am using jquery to display div upon selection which is store to database\[code\]<script type="text/javascript"> jQuery(document).ready(function(){ jQuery("input[name$='advert_specifications[link_type]']").click(function(){ var radio_value = http://stackoverflow.com/questions/12795226/jQuery(this).val(); if(radio_valuehttp://stackoverflow.com/questions/12795226/=='advert_page') { jQuery("#urlbox").hide('fast'); } else if(radio_valuehttp://stackoverflow.com/questions/12795226/=='external_link') { jQuery("#urlbox").show('fast'); } }); jQuery("#urlbox").hide(); }); </script><div class="my_meta_control"> <!--[advert link type group]--> <div class="left side clearfix"> <label class="left sub_label"><input type="radio" value="http://stackoverflow.com/questions/12795226/advert_page" name="advert_specifications[link_type]"> Page Link</label> <label class="left sub_label"><input type="radio" checked="checked" value="http://stackoverflow.com/questions/12795226/external_link" name="advert_specifications[link_type]"> External Link</label> </div> <!--[end of advert link type group]--> <div id="urlbox" style="display: none;"> <p class="sidebox clearform"> <label>Advert External Link</label> <input type="text" class="mydatepicker" value="" name="advert_specifications[advert_url]" id="advertdate"> </p> </div></div>\[/code\]It is working fine on click function but once I select external link radio and save to db than re open the post than #urlbox is always hide where it should be visible if external link radio button selected.EDIT:I tried this code and it does the same thing hiding \[code\]# + test\[/code\] div on load\[code\]jQuery(document).ready(function() { jQuery("div.links").hide(); jQuery("input[name$='advert_specifications[link_type]']").click(function() { var test = jQuery(this).val(); jQuery("div.links").hide(); jQuery("#" + test).show(); });});\[/code\]
 
Back
Top