1

I want to have a radio button to be selected as default in VF page.

<input type="radio" name="protocol" value="http" checked/>http
<input type="radio" name="protocol" value="https"/>https <br/>

But this throws up an error while saving the VF page

Attribute name "checked" associated with an element type "input" must be followed by the ' = ' character.

Any idea what is the right syntax?

2 Answers 2

3

You need to use following syntax:

checked="checked"
1
  • I couldnt find an answer when i googled it, thought it would be good if i put it out here if someone else had the same issue
    – Prady
    Sep 5, 2014 at 12:32
1

It had to be checked="checked"

<input type="radio" name="protocol" value="http" checked="checked" />http

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .