internal FormButtonGroupItem( FormButtonGroup groupControl, IHtmlElement element )
      : base( groupControl )
    {

      if ( groupControl == null )
        throw new ArgumentNullException( "groupControl" );

      if ( element == null )
        throw new ArgumentNullException( "element" );

      if ( !element.Name.EqualsIgnoreCase( "input" ) )
        throw new InvalidOperationException();

      if ( !element.Attribute( "name" ).Value().EqualsIgnoreCase( groupControl.Name ) )
        throw new InvalidOperationException();

      var type = element.Attribute( "type" ).Value();

      if ( type.EqualsIgnoreCase( "radio" ) )
        ButtonType = FormGroupButtonType.RadioButton;

      else if ( type.EqualsIgnoreCase( "checkbox" ) )
        ButtonType = FormGroupButtonType.RadioButton;

      else
        throw new InvalidOperationException();

      Element = element;
    }
        internal FormButtonGroupItem(FormButtonGroup groupControl, IHtmlElement element)
            : base(groupControl)
        {
            if (groupControl == null)
            {
                throw new ArgumentNullException("groupControl");
            }

            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            if (!element.Name.EqualsIgnoreCase("input"))
            {
                throw new InvalidOperationException();
            }

            if (!element.Attribute("name").Value().EqualsIgnoreCase(groupControl.Name))
            {
                throw new InvalidOperationException();
            }

            var type = element.Attribute("type").Value();

            if (type.EqualsIgnoreCase("radio"))
            {
                ButtonType = FormGroupButtonType.RadioButton;
            }

            else if (type.EqualsIgnoreCase("checkbox"))
            {
                ButtonType = FormGroupButtonType.RadioButton;
            }

            else
            {
                throw new InvalidOperationException();
            }

            Element = element;
        }