Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
166 lines (153 sloc) 4.56 KB
__NAME__ purpose
create HTML or JavaScript form submit button
__END__
__NAME__ synopsis2
<row>
<entry><arg choice='plain'>name</arg></entry>
<entry>Yes</entry><entry></entry>
<entry><literal>mv_click</literal></entry>
<entry>Button name.</entry>
</row>
<row>
<entry><arg choice='plain'>src</arg></entry>
<entry>Yes</entry><entry></entry>
<entry></entry>
<entry>
Image file to use. If the value starts with <literal>http</literal>,
it is used <emphasis>as-is</emphasis>. Otherwise the tag makes sure the
image file is reachable. Requires &glos-js;.
</entry>
</row>
<row>
<entry><arg choice='plain'>text</arg></entry>
<entry>Yes</entry><entry></entry>
<entry></entry>
<entry>
Button text. &glos-scratch; variable
of the same name is also created to
hold the code associated with the button.
</entry>
</row>
<row>
<entry><arg choice='plain'>wait-text</arg></entry>
<entry></entry><entry></entry>
<entry></entry>
<entry>
Button text to show while the next page is being loaded.
If defined, this is used for the
&glos-scratch; variable name instead of the
<arg choice='plain'>text</arg> argument value. Requires &glos-js;.
</entry>
</row>
<row>
<entry><arg choice='plain'>form</arg></entry>
<entry></entry><entry></entry>
<entry>First form on the page (document.forms[0])</entry>
<entry>Form name that this button will submit.</entry>
</row>
<row>
<entry><arg choice='plain'>confirm</arg></entry>
<entry></entry><entry></entry>
<entry></entry>
<entry>
Text for the "Yes/No" confirmation window that will show up before
the client's browser starts with form submission.
Requires &glos-js;.
</entry>
</row>
<row>
<entry><arg choice='plain'>getsize</arg></entry>
<entry></entry><entry></entry>
<entry>0</entry>
<entry>
Use <classname>Image::Size</classname> Perl module to determine image size and
add <arg choice='plain'>width</arg> and <arg choice='plain'>height</arg>
attributes to the image definition?
</entry>
</row>
<row>
<entry><arg choice='plain'>alt</arg></entry>
<entry></entry><entry></entry>
<entry>Value of the <arg choice='plain'>text</arg> parameter.</entry>
<entry>Alternate text for the browser status bar (window.status)
and <olink targetdoc='glossary' targetptr='balloon'>balloons</olink>.
</entry>
</row>
<row>
<entry><arg choice='plain'>anchor</arg></entry>
<entry></entry><entry></entry>
<entry>Value of <arg choice='plain'>text</arg></entry>
<entry>HTML &glos-anchor; name.
</entry>
</row>
<row>
<entry><arg choice='plain'>hidetext</arg></entry>
<entry></entry><entry></entry>
<entry>0</entry>
<entry>Hide button text?</entry>
</row>
&ROW_EXTRA_none;
&ROW_HTML_std;
&ROW_CSS_std;
&TAG_CONTAINER;
__END__
__NAME__ see also
env
__END__
__NAME__ notes
The &tag-button; tag can work with unnamed forms.
__END__
__NAME__ description
This tag creates a <mv>mv_click</mv> HTML form submit button.
</para><para>
Standard, text-only submit button is output in the form of
<![CDATA[<input type='submit' ...>]]>.
</para><para>
&glos-js; submit button can contain an image in place of the standard
button text and is output as a combination of
<![CDATA[<a href=...>]]> and
<![CDATA[<img src=...>]]> HTML tags.
It can also produce other enhancements to the plain submit button, such
as confirmation popup windows.
</para><para>
See <xref linkend='button_examples'/> for illustrative presentation.
__END__
__NAME__ example: Submit button with an image and confirmation window
Notice the tags used in the button body:
<programlisting>
[button text="Delete item" confirm="Are you sure?" src="delete.gif"]
[comment]
[button] element's body specifies the action code. It is what you would
put inside [set Delete item][/set] if you were creating the button
manually.
[/comment]
[mvtag] Use any Interchange tag here, i.e. ....[/mvtag]
[perl] # code to delete item [/perl]
[/button]
</programlisting>
__END__
__NAME__ example-inp: Creating the submit button manually
We are here to discuss the usage of the <tag>button</tag> tag, but let's
take a look at an
example equivalent to the one above, except that we create the button
manually:
<programlisting>
[set Delete item]
[comment]
[button] element's body specifies the action code.
[/comment]
[mvtag] Use any Interchange tag here, i.e. ....[/mvtag]
[perl] # code to delete item [/perl]
[/set]
<![CDATA[
<input type='submit' name='mv_click' value='Delete item'>
]]>
</programlisting>
__END__
__NAME__ example-js: Simple button with an embedded custom JavaScript code
<programlisting>
[button text="Click me"]
[javascript]onClick="myOwnOnClickFunction(this);"[/javascript]
[/button]
</programlisting>
__END__