Submit

From PhiWiki
Jump to: navigation, search


Name submit Submit.png
WID: 7
Type: Input
Available since: v1.0.0
Brief description: Submit button item. More...
Basic functions
Positioning Animation Transformation Display
.x() .fadeIn() .rotateX() .cursor()
.y() .fadeOut() .rotateY() .disabled()
.left() .rotate() .rotateZ() .opacity()
.top() .moveBy() .rotateToX() .hide()
.width() .moveTo() .rotateToY() .show()
.height() .rotateIn() .rotateToZ() .visible()
.pos() .rotateOut() .scale() .toggle()
.zIndex() .slide() .scaleTo() .title()
.tabIndex() .stop() .$() .wid()
Basic event handler
Button Mouse Key Misc Custom
.click() .mouseover() .keydown() .focus() .on()
.dblclick() .mouseout() .keyup() .blur() .off()
.mousedown() .mousemove() .keypress() .drop() .one()
.mouseup() .trigger()
Additional functions / handlers
Function Brief description
.val() Button text
.accessKey() Focus with short-cut
.color() Text color

Detailed description

Creates a native OS submit button with a button text. A submit button sends the complete form and its own id with the button text via a POST request. To check the form before submitting reimplement phi.onsubmit().

Note: setting a background color for native OS buttons is not equally supported by all Browsers, so the bgColor is currently not well implemented and should not be used.

Mac OSX notes: native buttons usually follow the OS GUI style, i.e. the height is not respected for heights below 35 pixels and has always the same height (with rounded corners). Using heights with more then 34 pixels the button will be drawn as expected but with rectangular geometry.

See also: Button, Reset, Filebutton, phi.onsubmit(), window.document.phiform.submit().

Additional functions

.val() .accessKey() .color()

.val()


Synopsis

.val([v])
Returns (read): String
Environment: ServerScriptOk.png JavaScriptOk.png
Available since: v1.5.0 v1.3.0
Brief description: Changes the value (content)
Attribute Type Default Note
v String Value which will be usually sent in POST requests.

Overview

Description

Read: returns the current value (content) of this item.

Write: sets the current value to v, i.e. this value will be sent as a id=value pair via POST request.

Note: Values from Button and Reset items are not send as POST data. Used with button items, this function usually changes the button text also.

See also:

.accessKey()


Synopsis

.accessKey([c])
Returns (read): String
Environment: ServerScriptOk.png JavaScriptOk.png
Available since: v1.5.0 v1.3.0
Brief description: Add an access key (shortcut).
Attribute Type Default Note
c String Single character

Overview

Description

Read: returns the current access key of this item.

Write: sets the current access key to to c.

Note: most browser support a single key for the item to get focus in combination with a meta-key:

  • Safari: CTRL+ALT+key
  • Firefox: ALT+SHIFT+key (Windows & Linux), CTRL+ALT+key (Mac OSX)
  • IE: ALT+key
  • Chrome: ALT+key (Windows & Linux), CTRL+ALT+key (Mac OSX)

See also: .focus(), .blur().

.color()


Synopsis

.color(['col'])
Returns (read): 'rgba(r, g, b, a)'
Environment: ServerScriptOk.png JavaScriptOk.png
Available since: v1.5.0 v2.0.0
Brief description: Text or foreground color change.
Attribute Type Default Note
col String Possible values are: color name, #RRGGBB, rgb(r,g,b), rgba(r,g,b,a)

Overview

Description

Allowed values for r, g, b are 0-255 and for a 0-1.0 (0 is fully transparent and 1. is opaque).

Read: returns the current text or foreground color as 'rgba( r, g, b, a)' string.

Write: changes the text or foreground color to col.

Note: some older browser versions do not support rgba() - in this case the alpha component will be ignored.

See also: .bgColor().

Example

var c=$('id').color(); // read
$('id').color('red'); // write
$('id').color('#12BAF1'); // write
$('id').color('rgb(12,177,255)'); // write
$('id').color('rgba(12,177,255,0.5)'); // write