<?
class frmHints extends MForm
{
		function __construct() 
		{
			parent::__construct('Controls Hints Sample');
			if ($this->page->isPostBack())
			{
				$this->eventHandler();
			}
            $this->addField(new ViewSource(__FILE__));
		}

		function CreateFields()
		{
            $fields = array(
               new MText('txt','Posicione o cursor sobre o campo de entrada para ver o hint'),
               new MTextField('edtMoney1','','Valor'),
               new MTextField('edtMoney2','','Soma'),
               new MTextField('edtMoney3','','Total'),
               new MSeparator()
            );
            $this->setFields($fields);
            $this->edtMoney1->setJsHint('Valor inicial a ser aplicado na soma'); 
            $this->edtMoney2->setJsHint('Valor a ser somado no valor inicial'); 
            $this->edtMoney3->setJsHint('Resultado da soma'); 
            $this->txt->setBold();
            $this->setFieldAttr('edtMoney3','readonly',true); 
			$buttons = array(
				new MButton('btnPost','Enviar')
			);
			$this->setButtons($buttons);
		}

		function btnPost_click()
		{
            $money1 = $this->getFieldValue('edtMoney1');
            $money2 = $this->getFieldValue('edtMoney2');
            $this->addField(new MTextLabel('lblMoney1',$money1,'GetField 1'));
            $this->addField(new MTextLabel('lblMoney2',$money2,'GetField 2'));
            $this->setFieldValue('edtMoney3', $money1 + $money2);
		}
}
?>