Source for file HTMLSubmitButton.class.php
Documentation is available at HTMLSubmitButton.class.php
* For including this file you have to define the constant "CLASSPATH".
* Because every include in the framework depends on the CLASSPATH definition.
* The CLASSPATH means the relative path to the folder that contains the
echo "<h3>You have to define the constant CLASSPATH!</h3>\n";
echo "Example: define( 'CLASSPATH', '../path/to/classes/' );\n";
require_once( CLASSPATH. "forms/items/ABSTHTMLFormItem.class.php" );
* @author Daniel Plücken <daniel@debakel.net>
* @license http://www.gnu.org/copyleft/lesser.html
* GNU Lesser General Public License
* @copyright Copyright (c) 2004 Daniel Pluecken <daniel@debakel.net>
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
* @var string $label_on_submit_success
* @author Daniel Plücken <daniel@debakel.net>
* Sets the value of the onMouseup-attribute of this submit button.
* @author Daniel Plücken <daniel@debakel.net>
* Sets the label of this button on mouseup if the form data could be send.
* @author Daniel Plücken <daniel@debakel.net>
* Sets the javascript to change the label of this button on mouseup if the
* form data could be send.
* @author Daniel Plücken <daniel@debakel.net>
$str_tmp = "str_onsbt = ''; "
. ".onsubmit.toString(); "
. "int_spos = str_onsbt.search( /return/ ) + 7; "
. "bool_submit_success = true; "
. "str_onsbt = str_onsbt.substr( int_spos ); "
. "int_spos = str_onsbt.search( /;/ ); "
. "str_onsbt = str_onsbt.substr( 0, int_spos ); "
. "try { bool_submit_success = eval( str_onsbt ); } "
. "str_mem_name = this.name; "
. "str_mem_value = this.value; "
. "if ( bool_submit_success ) "
. "document.GGobj_global_tmp=this; "
. "'document.GGobj_global_tmp"
. "this.name = str_mem_value + 'BACKUP'; "
. "obj_input = document.createElement( 'input' ); "
. "obj_input.setAttribute( 'type', 'hidden' ); "
. "obj_input.setAttribute( 'name', str_mem_name ); "
. "obj_input.setAttribute( 'value', str_mem_value ); "
. ".appendChild( obj_input ); "
. "document.". $this->parentform->name. ".submit(); "
* Blind method cause other objects will invoke it.
* @author Daniel Plücken <daniel@debakel.net>
* @param string $formname
* @return boolean (false)
* Blind method cause other objects will invoke it.
* @author Daniel Plücken <daniel@debakel.net>
* @param string $formname
* @return boolean (false)
* Returns a generated string based on the attributes of this object.
* @author Daniel Plücken <daniel@debakel.net>
* @param string forminput POST or GET or REQUEST
. " name=\"". $this->name. "\"\r\n";
$out .= !empty( $this->id )
? " id=\"". $this->id. "\"\r\n" : "";
$out .= !empty( $this->value )
? " value=\"". $this->value. "\"\r\n" : "";
? " onMouseup=\"". $this->mouseup. "\"\r\n" : "";
$out .= !empty( $this->click )
? " onClick=\"". $this->click. "\"\r\n" : "";
? " onMouseover=\"". $this->mouseover. "\"\r\n" : "";
? " onMouseout=\"". $this->mouseout. "\"\r\n" : "";
? " onMousemove=\"". $this->mousemove. "\"\r\n" : "";
$out .= !empty( $this->focus )
? " onFocus=\"". $this->focus. "\"\r\n" : "";
$out .= !empty( $this->blur )
? " onBlur=\"". $this->blur. "\"\r\n" : "";
? " style=\"". $this->freestyle. "\"\r\n" : "";
} // END of class HTMLSubmitButton
|