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

  • Home
  • SEARCH
  • 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 6320623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:00:29+00:00 2026-05-24T16:00:29+00:00

Please any one help me to show and hide the text box appropriately. Response:

  • 0

Please any one help me to show and hide the text box appropriately.

Response: 
  <label>
    <select name="call_response" id="call_response">
    <option value="No Answer">No Answer</option>
    <option value="Not Available">Not Available</option>
    <option value="Not In Use">Not In Use</option>
    <option value="On MC, PL">On MC, PL</option>
    <option value="Pending Case">Pending Case</option>
    <option value="Other">Others - To specify</option>
    </select>
  </label><br><div id="hiddendiv">
<input type="text" id="othertextbox" />
</div>

jQuery code:

$(function()
{
$("#hiddendiv").hide();
});

$("#call_response").change(function()
{
if($("#call_response").find(":selected").val($(this).val()) == "Other")
{
    $("#hiddendiv").show();
}
});

$("#othertextbox").change(function(){

$("#call_response").val($("#othertextbox").text());});


Update from OP comment:

“I try in javascript I got the answer. How I can change to jquery? Please give
some idea.”

function setupScript() {
    OtherOnchanged('call_response', 'SPAN_Other', 'Other');
}
function displayNhide(display, status) {
    document.getElementById(display).style.display = status;
}
function OtherOnchanged(onChangedid, spanId, valueToCheck) {
    var value = document.getElementById(onChangedid).value;
    if (value == valueToCheck) {
        displayNhide(spanId, 'block');
    } else {
        displayNhide(spanId, 'none');
    }
}
  • 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-05-24T16:00:30+00:00Added an answer on May 24, 2026 at 4:00 pm

    You cannot set a <select>s value to something for which there is no option (at least with jQuery).

    Add a hidden field for the real value, like so:

    <label> Response:
    <select name="call_response" id="call_response">
        <option value="No Answer">No Answer</option>
        <option value="Not Available">Not Available</option>
        <option value="Not In Use">Not In Use</option>
        <option value="On MC, PL">On MC, PL</option>
        <option value="Pending Case">Pending Case</option>
        <option value="Other">Others - To specify</option>
    </select>
    </label><br>
    
    <input type="hidden" id="real_call_response"/>
    
    <div id="hiddendiv">
        <input type="text" id="othertextbox"/>
    </div>
    

    Then activate it all with this jQuery:

    $("#call_response").change ( function () {
        $("#real_call_response").val ( $("#call_response").val () );
    
        if ( $("#call_response").val ()  ==  "Other") {
            $("#hiddendiv").show().find('input').focus();
        }
        else
            $("#hiddendiv").hide();
    } );
    
    $("#othertextbox").bind ("change keypress keyup blur", function () {
        $("#real_call_response").val ( $("#othertextbox").val () );
    } );
    

    Note: Use CSS to hide hiddendiv initially.

    See it all in action at jsFiddle.



    Update:

    That new code, converted to jQuery is just:

    function setupScript() {
        OtherOnchanged('call_response', 'SPAN_Other', 'Other');
    }
    
    function OtherOnchanged (onChangedId, spanId, valueToCheck) {
    
        if ( $("#" + onChangedId).val() ==  valueToCheck)
            $("#spanId").show ()
        else
            $("#spanId").hide ()
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Any one please help me to build a horizontal bar graph in my android
Can we add image together with text in a picker view? Anyone please help!
Can any one please tell me the difference between target and currenttarget in flex?
Could any one please tell me the meaning of ++ with array in the
can any one help me to display set of results in my app in
Can anyone please help me to work out how to achieve the following? I
Can anyone please help me to add video controls (play, pause, forward, seekbar) to
Ok so could anyone please help me out with the VB for auto entering
Can anyone help me out please? I'm confused. I want to set up my
Can anyone help me spot the problem on this PLEASE? I'm eternally grateful for

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.