diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-10-26 08:17:13 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-10-26 08:17:13 +0000 |
| commit | 1b9fa06acb3c68871d5d87053d047430ff0acbfb (patch) | |
| tree | 39e1430c9c1e3531d0ec406c883a5643f59e6cb9 /frontends/php/include/classes | |
| parent | 4d02efc00fc5a4c076f12c4039197baf080c33d4 (diff) | |
| download | zabbix-1b9fa06acb3c68871d5d87053d047430ff0acbfb.tar.gz zabbix-1b9fa06acb3c68871d5d87053d047430ff0acbfb.tar.xz zabbix-1b9fa06acb3c68871d5d87053d047430ff0acbfb.zip | |
- developed IP input box (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3384 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/classes')
| -rw-r--r-- | frontends/php/include/classes/ctextbox.inc.php | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/frontends/php/include/classes/ctextbox.inc.php b/frontends/php/include/classes/ctextbox.inc.php index 587799ad..9f385afc 100644 --- a/frontends/php/include/classes/ctextbox.inc.php +++ b/frontends/php/include/classes/ctextbox.inc.php @@ -29,9 +29,9 @@ parent::CTag('input','no'); $this->tag_body_start = ''; $this->options['class'] = 'biginput'; - $this->options['name'] = $name; - $this->options['size'] = $size; - $this->options['value'] = $value; + $this->AddOption('name', $name); + $this->AddOption('size', $size); + $this->AddOption('value',$value); $this->SetReadonly($readonly); } function SetReadonly($value='yes') @@ -64,15 +64,17 @@ class CNumericBox extends CTextBox { - function CNumericBox($name='password',$value='',$size=20) + function CNumericBox($name='password',$value='',$size=20,$readonly="no") { - parent::CTextBox($name,$value,$size); - $this->options['OnKeyPress'] = + parent::CTextBox($name,$value,$size,$readonly); + $this->AddOption('MaxLength', $size); + $this->AddOption('Style', 'text-align: right;'); + $this->AddOption('OnKeyPress', " var c= (event.which) ? event.which : event.keyCode; ". - " if(c <= 31 || (c >= 48 && c <= 57)) return true; else return false; "; + " if(c <= 31 || (c >= 48 && c <= 57)) return true; else return false; "); } } -/* TEST + class CIpBox { var $ip_parts = array(); @@ -88,7 +90,17 @@ for($i = 0; $i < 4; $i++) { $this->ip_parts[$i] = new CNumericBox($name.'['.$i.']', $value[$i], 3); - if($i < 3) $this->ip_parts[$i]->tag_end = ''; + if($i != 3) + { + $this->ip_parts[$i]->tag_end = ''; + $this->ip_parts[$i]->AddOption('OnKeyDown', + ' this.maxlength = this.getAttribute("maxlength"); '. + ' this.oldlength = this.value.length; '); + $this->ip_parts[$i]->AddOption('OnKeyUp', + ' if(this.oldlength != this.value.length && this.value.length == this.maxlength) {'. + ' var el = this.form.elements["'.$name.'['.($i+1).']'.'"];'. + ' if(el) { el.focus(); el.select(); }}'); + } $this->ip_parts[$i] = unpack_object($this->ip_parts[$i]); } } @@ -107,6 +119,5 @@ echo $this->ToString($destroy); } } -TEST */ ?> |
