Solved

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

Posted on 2016-10-20
7
61 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 54

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 54

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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 109

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 54

Expert Comment

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

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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 dynamically set the form action using jQuery.

777 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