From b2302622e991406d43b19f78262ce08d3c5db69b Mon Sep 17 00:00:00 2001 From: rojaro <> Date: Fri, 21 Jan 2011 10:19:35 +0000 Subject: fixed #305 --- framework/Web/UI/WebControls/TTextBox.php | 40 ++++++++++++++++--------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'framework/Web/UI/WebControls') diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php index 8ab548a3..46e7f551 100644 --- a/framework/Web/UI/WebControls/TTextBox.php +++ b/framework/Web/UI/WebControls/TTextBox.php @@ -122,25 +122,6 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable $writer->addAttribute('type','text'); if(($text=$this->getText())!=='') $writer->addAttribute('value',$text); - if(($act=$this->getAutoCompleteType())!=='None') - { - if($act==='Disabled') - $writer->addAttribute('autocomplete','off'); - else if($act==='Search') - $writer->addAttribute('vcard_name','search'); - else if($act==='HomeCountryRegion') - $writer->addAttribute('vcard_name','HomeCountry'); - else if($act==='BusinessCountryRegion') - $writer->addAttribute('vcard_name','BusinessCountry'); - else - { - if(strpos($act,'Business')===0) - $act='Business'.'.'.substr($act,8); - else if(strpos($act,'Home')===0) - $act='Home'.'.'.substr($act,4); - $writer->addAttribute('vcard_name','vCard.'.$act); - } - } } else { @@ -148,6 +129,27 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable $writer->addAttribute('value',$text); $writer->addAttribute('type','password'); } + + if(($act=$this->getAutoCompleteType())!=='None') + { + if($act==='Disabled') + $writer->addAttribute('autocomplete','off'); + else if($act==='Search') + $writer->addAttribute('vcard_name','search'); + else if($act==='HomeCountryRegion') + $writer->addAttribute('vcard_name','HomeCountry'); + else if($act==='BusinessCountryRegion') + $writer->addAttribute('vcard_name','BusinessCountry'); + else + { + if(strpos($act,'Business')===0) + $act='Business'.'.'.substr($act,8); + else if(strpos($act,'Home')===0) + $act='Home'.'.'.substr($act,4); + $writer->addAttribute('vcard_name','vCard.'.$act); + } + } + if(($cols=$this->getColumns())>0) $writer->addAttribute('size',"$cols"); if(($maxLength=$this->getMaxLength())>0) -- cgit v1.2.3