Skip to content
This repository
tree: 01330ec25d
Fetching contributors…

Cannot retrieve contributors at this time

file 164 lines (153 sloc) 4.667 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
__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__
Something went wrong with that request. Please try again.