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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:07:28+00:00 2026-05-22T23:07:28+00:00

I.e. a regular select, but when I choose Custom, a text input appears, and

  • 0

I.e. a regular select, but when I choose “Custom”, a text input appears, and I can use that instead, as in this crude drawing:

 [Choice A ^]

becomes

 [Custom   ^] ____________
 [Choice A  ]
 [Choice B  ]
 [Choice C  ]

I can build it, but it’s a common pattern….

Note: I’m not talking about a combo box.

  • 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-22T23:07:29+00:00Added an answer on May 22, 2026 at 11:07 pm

    The trickier part here is, that presumably you want the input and select box to both use the same name, so whatever is processing the form data, won’t have to wonder what was selected, but instead just read the value from the one and same name.

    My take on this:

    var i;
    var b = false;
    $("select").change(function(){
        if($("option:selected",this).hasClass('custom')){
         i = $('<input />').attr('name','values').insertAfter(this);   
             }else{
              $(i).remove();   
             }
    });
    
    $('form').submit(function(e){
        if (!b){
       e.preventDefault();
        if ($(i).length>0){
         $('select').remove();  
        } else{
         $(i).remove();   
        }
         b = true;
        $(this).trigger('submit');
    }
    
    });
    

    example: http://jsfiddle.net/niklasvh/Cq59K/ (have a look at the form submission data, uses same name for fields, and doesn’t have duplicate entries i.e. combo box and input box).

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

Sidebar

Related Questions

I need a regular expression to select all the text between two outer brackets.
I know that snapshot isolation would fix this problem, but I'm wondering if NOLOCK
I've been googling & trying to get this myself but can't quite get it...
Hey guys, I'm trying to select a specific string out of a text, but
I want to select some files that are matching a regular expression. Files are
I have such a regular expression: re.compile(r"((https?):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)", re.MULTILINE|re.UNICODE) But that doesn't include hashbangs (#!)
I'm trying to select some text using regular expressions leaving all img tags intact.
How can I rename table column renaming using LINQ like in regular SQL SELECT
Im confident that this isnt a sharepoint 2007 issue, but id rather cover all
I need a select-box with multiple columns when expanded - I know that this

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.