Welcome Guest, Not a member yet? Register   Sign In
Make a Checkbox disabled
#1

[eluser]bgougent[/eluser]
I have these lines of code in several forms, after validating (XHTML 1.1 Stricty) I get this error :
Quote:syntax of attribute value does not conform to declared value

The CI Code :
Code:
$inputpreferences   = array( 'name'        => 'commentflag',
                             'id'          => 'commentflag',
                             'value'       => 'N',
                             'checked'     => false,                                                    
                             'disabled'    => ''
                            );
echo form_checkbox($inputpreferences).'some text';

This is the actual HTML result :
Code:
<input type="checkbox" name="commentflag" value="N" id="commentflag" disabled=""  />

What the actual result should be :
Code:
<input type="checkbox" name="commentflag" value="N" id="commentflag" disabled  />

Is there a correct way in CI 1.6.3 to solve this problem?
#2

[eluser]Nick Husher[/eluser]
What you want to do is 'disabled'=>'disabled'. XHTML doesn't allow for attribute minimization, so you're required to duplicate the name in the value field:

Code:
<input type="checkbox" name="commetflag" value="N" id="commentflag" disabled="disabled" />




Theme © iAndrew 2016 - Forum software by © MyBB