Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8647645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:07:10+00:00 2026-06-12T13:07:10+00:00

I am using jquery to display div upon selection which is store to database

  • 0

I am using jquery to display div upon selection which is store to database

<script type="text/javascript"> 
    jQuery(document).ready(function(){

        jQuery("input[name$='advert_specifications[link_type]']").click(function(){

            var radio_value = jQuery(this).val();

            if(radio_value=='advert_page') {
                jQuery("#urlbox").hide('fast');
            }
            else if(radio_value=='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="advert_page" name="advert_specifications[link_type]"> Page Link</label>        
        <label class="left sub_label"><input type="radio" checked="checked" value="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>

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 # + test div on load

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();
    });
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:07:11+00:00Added an answer on June 12, 2026 at 1:07 pm

    As per my understing in you main script you are hiding the main block. Although its not needed because you are alreadying saying display none in your markup.

    Please check the jsfiddle link

    DEMO

    http://jsfiddle.net/saorabhkr/DFPAX/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jquery to display an error div, which is defined as: <div
I have div(box) on my page and I'm using this script to display div
I am using the following sliding div script: http://www.webdesignerwall.com/demo/jquery/simple-slide-panel.html Currently, the slidetoggle function is
I have the following html (i'm also using Jquery and JqueryUI) <div style=display:none; position:fixed;
I am using jQuery to display content on a website based upon the menu
I'm using jQuery ColorBox to display a shopping cart item. When a user enters
I am trying to display a button using jQuery template. The code is as
I recently started using JQuery and created a little slider to display logos of
How to prompt browser to display open/save dialog box using jquery?
How can I change CSS display none or block property using jQuery?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.