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 8310339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:25:33+00:00 2026-06-08T19:25:33+00:00

Here’s the issue: I created a drop down menu displaying security questions. One of

  • 0

Here’s the issue:

I created a drop down menu displaying security questions. One of the options is “Other”. If “Other” is selected, a text box pops up beside the drop down menu prompting the user to input his own security question.

That all works great, but when a user selects “Other” and an error occurs (in another part of the form), the scroll down menu still displays “Other”, but the text box beside it disappears. Is there a way to keep the text box there if $_POST[‘question’] == other?

Here’s an excerpt of my code, I can show more if it would be useful.

   <script type="text/javascript">
        $(function(){
            //initially hide the textbox
            $("#other_question").hide();
            $('#dd_question').change(function() {
              if($(this).find('option:selected').val() == "0"){
                $("#other_question").show();
              }else{
                $("#other_question").hide();
              }
            });
        });
    </script>

Here’s the code for the drop down menu (in php)

$option_list = array(
        "1" => "In what city did your parents meet?",
        "2" => "What is your mother's maiden name?",
        "3" => "What was the name of your first pet?",
        "4" => "What is your oldest sibling's middle name?",
        "0" => "Other",
    );
foreach ($option_list as $option_id => $option) {
        echo "<option value = \"{$option_id}\" ";
        if ($option_id == $_POST['dd_question']) {
            echo " selected=\"selected\"";
        }
    echo ">{$option}</option>";
}

Thanks in advance for all suggestions!

  • 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-08T19:25:35+00:00Added an answer on June 8, 2026 at 7:25 pm

    On page load always check for other option
    instead of

    //initially hide the textbox
                $("#other_question").hide();
    

    do

    //initially check the default value in dd_question
    if($('#dd_question').find('option:selected').val() == "0"){
                    $("#other_question").show();
                  }else{
                    $("#other_question").hide();
                  }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {
Here is the script I'm using, copied directly from Google: <script type=text/javascript> var _gaq
Here's my procedure: DROP PROCEDURE IF EXISTS `couponExpires`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `couponExpires`(IN couponID BIGINT,
Here is a simple timepicker to jQuery UI's datepicker <script type=text/javascript> /* <![CDATA[ */
Here is my question. I am having this simple menu. <div id=menu> <ul> <li>
Here is the issue I am having: I have a large query that needs
I know there's a lot of other questions out there that deal with this
Here i need to attach one image with mail, the passing image like this
Here's the JsFiddle: http://jsfiddle.net/d6mmZ/7/ Clicking links 1 and 2 updates the text instantly. Clicking
Here is a broken down version of my problem : I have a method.

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.