Solved

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

Posted on 2016-10-20
7
56 Views
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
0
Comment
Question by:Eduardo Fuerte
  • 3
  • 3
7 Comments
 
LVL 51

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 -->
</div>

Open in new window

0
 

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>
	</select>
</span>


 <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>
	</label>
</div>

Open in new window

0
 
LVL 51

Accepted Solution

by:
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?
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 108

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.
0
 

Author Closing Comment

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

Runs perfectly.

Thank you!
0
 

Author Comment

by:Eduardo Fuerte
ID: 41852407
@Ray

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

Expert Comment

by:Julian Hansen
ID: 41852447
You are welcome.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now