GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ROSE::HTML::FORM::FIELD::OPTION (3)

.ds Aq ’

NAME

Rose::HTML::Form::Field::Option - Object representation of the "option" HTML tag.

CONTENTS

SYNOPSIS



    $field =
      Rose::HTML::Form::Field::Option->new(
        value => apple,
        label => Apple);

    $field->selected(1);

    print $field->html;

    ...



DESCRIPTION

Rose::HTML::Form::Field::Option is an object representation of a single option in a pop-up menu or select box in an HTML form.

This class inherits from, and follows the conventions of, Rose::HTML::Form::Field. Inherited methods that are not overridden will not be documented a second time here. See the Rose::HTML::Form::Field documentation for more information.

HTML ATTRIBUTES

Valid attributes:



    accept
    accesskey
    alt
    checked
    class
    dir
    disabled
    id
    ismap
    label
    lang
    maxlength
    name
    onblur
    onchange
    onclick
    ondblclick
    onfocus
    onkeydown
    onkeypress
    onkeyup
    onmousedown
    onmousemove
    onmouseout
    onmouseover
    onmouseup
    onselect
    readonly
    selected
    size
    src
    style
    tabindex
    title
    type
    usemap
    value
    xml:lang



Required attributes:



    value



Boolean attributes:



    checked
    disabled
    ismap
    readonly
    selected



CONSTRUCTOR

<B>new PARAMSB> Constructs a new Rose::HTML::Form::Field::Option object based on PARAMS, where PARAMS are name/value pairs. Any object method is a valid parameter name.

OBJECT METHODS

<B>hidden [BOOL]B> Get or set a boolean value that indicates whether or not this radio button will be shown in its parent select box, pop-up menu, or option group. Setting it to true also sets selected to false.
<B>hideB> Calls hidden, passing a true value.
<B>selected [BOOL]B> Select or unselect the option by passing a boolean value. If BOOL is true, the option will be selected. If it’s false, it will be unselected. Returns true if the option is selected, false otherwise.
<B>short_label [TEXT]B> Get or set the value of the label HTML attribute. When present, user agents are supposed to use this value instead of the contents of the option tag as the label for the option. Example:



    $field =
      Rose::HTML::Form::Field::Option->new(
        value => apple,
        label => Shiny Apple);

    print $field->html;

    # The HTML:
    #
    #   <option value="apple">Shiny Apple</option>
    #
    # Label shown in web browser: "Shiny Apple"

    $field->short_label("Apple");
    print $field->html;

    # The HTML:
    #
    #   <option label="Apple" value="apple">Shiny Apple</option>
    #
    # Label shown in web browser: "Apple"



(Hey, don’t look at me, I didn’t write the HTML specs...)

<B>showB> Calls hidden, passing a false value.

AUTHOR

John C. Siracusa (siracusa@gmail.com)

LICENSE

Copyright (c) 2010 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 ROSE::HTML::FORM::FIELD::OPTION (3) 2015-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.