Solved

Disabled Fieldset Attribute in HTML5

Posted on 2013-11-15
7
705 Views
Last Modified: 2013-11-15
Hi

I have a form (as below) and depending on whether it's in edit mode or view mode I lock the form elements. This is fine. The issue i have is with ie 9 which doesnt support the html5 disabled attribute

whats the best way of going about this, what kind of polyfill would i need ?

(I am using bootstrap 3)

<fieldset disabled>
                    
                    
<div class="form-group">
 <label for="clientname" class="col-lg-2 control-label">Company Name</label>
 <div class="col-lg-10">
 <input title="The name of the Client" value="<?php echo $ClientName?>" type="text" class="form-control initial_caps" id="clientname" placeholder="The name of the Client" name="clientname" >
                          
</fieldset>

Open in new window

0
Comment
Question by:maddisoncr
[X]
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
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 19

Expert Comment

by:Albert Van Halen
ID: 39651119
Perhaps you can disabled the first div in the fieldset...
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39651130
Hi,
you might try this jQuery function:
var disabledFieldset = $('fieldset[disabled]');
$('input', disabledFieldset).attr('disabled', 'disabled');

Open in new window


This should disable all input fields in your fieldset.
HTH
Rainer
0
 

Author Comment

by:maddisoncr
ID: 39651153
thanks guys

that will work for browsers that support 'disabled' but i'm led to believe that ie 9 doesn't.

how would i go around testing to see if the browser supports the attribute..

i'm from a vb.net backround so i'm quickly learning the ropes. i did think modernizr but that doesn't check for the disabled attr..

any ideas

thanks again for your help
0
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 125 total points
ID: 39651185
Hi,
IE9 would not directly support the disabled on the fieldset but at least the disabled on the INPUT fields (even disabling option values is supported in IE9 - http://msdn.microsoft.com/en-us/library/ie/ms533732%28v=vs.85%29.aspx)
0
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 125 total points
ID: 39651399
For non input elements like fieldset, The disable attribute is new with HTML5 and not supported in IE9 or Safari.  The solution is to use the older more reliable approach of setting disabled on the inputs which is supported by all mainstream browsers and has been for at least 5 years.  It can be applied to all input types except 'hidden'.

Cd&
0
 

Author Closing Comment

by:maddisoncr
ID: 39651433
Thanks for your help
0

Featured Post

Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

622 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