Could you point how to disable all the combobox of a modal view at the same time?

Posted on 2016-10-20
Last Modified: 2016-10-20
Hi Experts

Could you point how to disable all the combobox of a modal view at the same time?

 $('#view input').prop("disabled", false);  // Runs OK for all inputs
 $('#view select.dropdown').attr('disabled', false); // It doesn't runs for combos.

Open in new window

Thanks in advance
Question by:Eduardo Fuerte
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 57

Expert Comment

by:Julian Hansen
ID: 41851971
$('#view select.dropdown').attr('disabled', false);

Open in new window

This will only act on <select> with class "dropdown"
<div id="view">
  <select class="dropdown"></select> <!--YES -->
  <select></select> <!-- No -->

Open in new window


Author Comment

by:Eduardo Fuerte
ID: 41851984
Could you sugest somtehing these cases:

<span class="select">          
	<select id="fk_seguradora" name="fk_seguradora">                 
		<option value="" selected="selected">...Cliente Corporativo...</option>
		<option value="1">XXXXX</option>
		<option value="2">YYYYY</option>
		<option value="3">ZZZZZ</option>

 <div class="col-xs-8 mb15">
	<label for="fk_nome_produto" class="field-label text-muted mb10">Nome do Produto</label>
	<label for="fk_nome_produto" class="validar field select">
		<?php echo $fk_nome_produto;?>
		<i class="arrow double"></i>

Open in new window

LVL 57

Accepted Solution

Julian Hansen earned 500 total points
ID: 41852030
Assuming the above is inside the #view you mentioned earlier then

$('#view .select select').prop('disabled',true)

Open in new window

Note in your opening code you had .prop('disabled',false) - your question says you want to disable the <select> which means you should be using a value of true not false?
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 110

Expert Comment

by:Ray Paseur
ID: 41852056
No points for this please, but there is a thing called semantic markup.  It refers to the use of meaningful and intentional names for data elements.  If you name a <span> with a meaningless word like "select" you're violating the concepts of semantics, and this leads to confusion when other people (or you, if you come back to this work a few days later) try to understand your intent.  A better practice is to think about the meaning of each data element in the browser viewport.  Give meaningful names to these data elements, and it will help you organize your thinking about the user-experience you're trying to produce.

Author Closing Comment

by:Eduardo Fuerte
ID: 41852403
Yes, for disable.

Runs perfectly.

Thank you!

Author Comment

by:Eduardo Fuerte
ID: 41852407

Thanks for advice.
I can sugest to adopt another more adequated word.
LVL 57

Expert Comment

by:Julian Hansen
ID: 41852447
You are welcome.

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question