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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:06:33+00:00 2026-06-17T02:06:33+00:00

I have this conditional select, which does what it’s supposed to. See fiddle here

  • 0

I have this conditional select, which does what it’s supposed to. See fiddle here. But I would like to make an exception or change to one of the items.

If you select “Other brands” in the first select box, then there’s a long text in the second select box because the script takes the text from the corresponding div:

$selector.append("<option value='" + $(this).attr('id') + "'>" + $(this).text() + "</option>");

I would like there to be another (shorter) text in the second select box – but only for this item – and without changing the content of the div.

How do I do that?

  • 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-17T02:06:34+00:00Added an answer on June 17, 2026 at 2:06 am

    You could do an if that says:

    if( $(this).text() != "Content not to be displayed in select box" ){
    //-- if something should be shown. change the text here --//
          }else{
                 //-- if the shorter text should be shown --//
    }
    

    If you set $(this).text() as a variable and then inject that, if the variable is too long, you can swap out the text for something else…

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

Sidebar

Related Questions

I have this: As you can see I currently have a conditional to include
I have ran across a few queries that use this where condition: select ...
I have this conditional in a perl script: if ($lnFea =~ m/^(\d+) qid\:([^\s]+).*?\#docid =
I'm a beginner at SQL and have this fairly easy conditional problem: Every installation
Say, you have a condition like this; if ($condition_1 && $condition_2) and you have
Conditions: Windows 98 SE WMI not available I have code that looks like this,
I have 2 queries which display 2 different values but the results from one
I have a named_scope which does a join. I have included the named_scope method
I have this query which runs a join on Books, TradingDesks and ProductInfos. The
I have looked for this in several places but not necessarily found the right

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.