@@ -44,7 +44,7 @@ |
||
44 | 44 | */ |
45 | 45 | public function client(IFormModel $model) |
46 | 46 | { |
47 | - $javaScript = 'if (/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(this.value' . |
|
47 | + $javaScript = 'if (/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(this.value'. |
|
48 | 48 | ') != true) { e.preventDefault(); this.focus(); alert(\'Value is not a URL\'); }'; |
49 | 49 | |
50 | 50 | return $javaScript; |
@@ -55,7 +55,7 @@ |
||
55 | 55 | */ |
56 | 56 | public function client(IFormModel $model) |
57 | 57 | { |
58 | - return 'if (this.value < ' . $this->params['min'] . ' || this.value > ' . $this->params['max'] . ') {' . |
|
58 | + return 'if (this.value < '.$this->params['min'].' || this.value > '.$this->params['max'].') {'. |
|
59 | 59 | ' e.preventDefault(); this.focus(); alert(\'Value not find in range\'); }'; |
60 | 60 | } |
61 | 61 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | */ |
45 | 45 | public function client(IFormModel $model) |
46 | 46 | { |
47 | - return 'if (/^[\w.-]{1,}@[\w.-]{1,}$/.test(this.value) != true) {' . |
|
47 | + return 'if (/^[\w.-]{1,}@[\w.-]{1,}$/.test(this.value) != true) {'. |
|
48 | 48 | ' e.preventDefault(); this.focus(); alert(\'Value is not a valid e-mail\'); }'; |
49 | 49 | } |
50 | 50 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | */ |
46 | 46 | public function client(IFormModel $model) |
47 | 47 | { |
48 | - return 'if (!this.value.match(' . $this->params['pattern'] . ')) {' . |
|
48 | + return 'if (!this.value.match('.$this->params['pattern'].')) {'. |
|
49 | 49 | ' e.preventDefault(); this.focus(); alert(\'Value not valid with regular expression\'); }'; |
50 | 50 | } |
51 | 51 | } |
@@ -59,11 +59,11 @@ |
||
59 | 59 | $javaScript = ''; |
60 | 60 | |
61 | 61 | if (!empty($this->params['min'])) { |
62 | - $javaScript .= ' if (this.value.length < ' . $this->params['min'] . ') { e.preventDefault(); this.focus();' . |
|
62 | + $javaScript .= ' if (this.value.length < '.$this->params['min'].') { e.preventDefault(); this.focus();'. |
|
63 | 63 | ' alert(\'Value lowest, minimum '.$this->params['min'].' symbols\'); }'; |
64 | 64 | } |
65 | 65 | if (!empty($this->params['max'])) { |
66 | - $javaScript .= ' if (this.value.length > ' . $this->params['max'] . ') { e.preventDefault(); this.focus();' . |
|
66 | + $javaScript .= ' if (this.value.length > '.$this->params['max'].') { e.preventDefault(); this.focus();'. |
|
67 | 67 | ' alert(\'Value highest, maximum '.$this->params['max'].' symbols\'); }'; |
68 | 68 | } |
69 | 69 |
@@ -68,7 +68,7 @@ |
||
68 | 68 | $value = $model->$attribute; |
69 | 69 | } |
70 | 70 | |
71 | - $javaScript = 'if (this.value!="' . $value . '") { e.preventDefault(); this.focus(); alert(\'Value is not compatible\'); }'; |
|
71 | + $javaScript = 'if (this.value!="'.$value.'") { e.preventDefault(); this.focus(); alert(\'Value is not compatible\'); }'; |
|
72 | 72 | |
73 | 73 | return $javaScript; |
74 | 74 | } |