Solved

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

Posted on 2016-10-20
7
63 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 55

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 55

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
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
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 55

Expert Comment

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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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 look for a specific file type in a local or remote server directory using PHP.

830 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