Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

238
Views
how to provide CSS for particular text in select option?

I am using bootstrap select-picker for multi line dropdown and have made slight modifications to enable multiple data columns to be binded in single dropdown.

Now , I want to use different text colour only for data values extracted from database.

Here is my code

 <select name="load" data-toggle="dropdown" class="selectpicker 
show-tick form-control col-lg-12 col-md-12 col-sm-4 col-xs-12" id="cmbID1" data-showContent="true" data-live-search="true" data-live-search-style="startsWith" data-size="10" data-width="350px">
                                <optgroup label="Load details">
                                  <option value="1">No data</option>
                                <asp:Repeater ID="RptLoad" runat= "server">
                                 <ItemTemplate> 
                                  <option value="6" data-divider="true"></option>
                              <option style="white-space:pre-wrap;max-width: 100%;overflow: hidden;word-wrap: normal !important;data-tokens="<%#Eval("Cust_Name")%>" data-content="Customer Name : <%# Eval("Cust_Name")%> <br> Location : <%# Eval("Loc_name") %> <br> Address: <%# Eval("Loc_Address") %> <br> Contact Person : <%# Eval("Loc_ContactP") %> <br> Phone No: <%# Eval("Loc_Phno") %> <br> Email Id : <%# Eval("Loc_Email") %>"><%# Eval("Loc_Id")%>  </option>                            
                             </ItemTemplate>
                              </asp:Repeater>
                                    </optgroup>                                                                                
                         </select>   

                            <script type="text/javascript">                       
                                $('.selectpicker').selectpicker();
                             </script> 

In the above code , I need only the value binded in eval() to be of different colour. for instance:- In the following text "Customer Name : <%# Eval("Cust_Name")%>" , I want Customer Name header in black color and <%# Eval("Cust_Name")%> in blue colour.

Is it possible to achieve this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Customer Name : <span style="color:blue"><%# Eval("Cust_Name")%></span>                     
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!