Link to home
Start Free TrialLog in
Avatar of maddisoncr
maddisoncr

asked on

Disabled Fieldset Attribute in HTML5

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

Avatar of Albert Van Halen
Albert Van Halen
Flag of Netherlands image

Perhaps you can disabled the first div in the fieldset...
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
Avatar of maddisoncr
maddisoncr

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for your help