当前位置: 首页>>代码示例>>PHP>>正文


PHP Wizard::getValidationJavascript方法代码示例

本文整理汇总了PHP中Wizard::getValidationJavascript方法的典型用法代码示例。如果您正苦于以下问题:PHP Wizard::getValidationJavascript方法的具体用法?PHP Wizard::getValidationJavascript怎么用?PHP Wizard::getValidationJavascript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Wizard的用法示例。


在下文中一共展示了Wizard::getValidationJavascript方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getMarkup

 /**
  * Returns a block of XHTML-valid code that contains markup for this specific
  * component. 
  * @param string $fieldName The field name to use when outputting form data or
  * similar parameters/information.
  * @access public
  * @return string
  */
 function getMarkup($fieldName)
 {
     $name = RequestContext::name($fieldName);
     $m = "<input type='text' \n\t\t\t\tname='{$name}' \n\t\t\t\tid='{$fieldName}' \n\t\t\t\tsize='" . $this->_size . "' maxlength='" . $this->_maxlength . "'" . (!$this->isEnabled() ? " readonly='readonly'" : "");
     if ($this->_value != null && $this->_value != $this->_startingDisplay) {
         $m .= " value='" . htmlspecialchars($this->_value, ENT_QUOTES) . "'";
     } else {
         if ($this->_startingDisplay) {
             $v = htmlspecialchars($this->_startingDisplay, ENT_QUOTES);
             $m .= "\n\t\t\t\tvalue='{$v}' style='color: #888' ";
             $m .= "\n\t\t\t\tonfocus='if (this.value == \"{$v}\") { this.value=\"\";  this.style.color=\"#000\";}'";
             $m .= "\n\t\t\t\tonblur='if (this.value == \"\") { this.value=\"{$v}\"; this.style.color=\"#888\";}'";
         }
     }
     if ($this->_style) {
         $m .= "\n\t\t\t\tstyle=\"" . str_replace("\"", "\\\"", $this->_style) . "\"";
     }
     if ($this->_onchange) {
         $m .= "\n\t\t\t\tonchange=\"" . str_replace("\"", "\\\"", $this->_onchange) . "\"";
     }
     $m .= " />";
     $errText = $this->getErrorText();
     $errRule = $this->getErrorRule();
     $errStyle = $this->getErrorStyle();
     if ($errText && $errRule) {
         $m .= "\n\t\t<span id='" . $fieldName . "_error' style=\"padding-left: 10px; {$errStyle}\">&laquo; {$errText}</span>";
         $m .= Wizard::getValidationJavascript($fieldName, $errRule, $fieldName . "_error", $this->_showError);
         $this->_showError = false;
     }
     return $m;
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:39,代码来源:WTextField.class.php

示例2: getMarkup

 /**
  * Returns a block of XHTML-valid code that contains markup for this specific
  * component. 
  * @param string $fieldName The field name to use when outputting form data or
  * similar parameters/information.
  * @access public
  * @return string
  */
 function getMarkup($fieldName)
 {
     $name = RequestContext::name($fieldName);
     $m = "\n\t\t\t<textarea rows='" . $this->_rows . "' cols='" . $this->_cols . "'";
     if (isset($this->_wrapStyle) && is_string($this->_wrapStyle)) {
         $m .= " wrap='" . $this->_wrapStyle . "'";
     }
     $m .= "\n\t\t\t\tname='{$name}'";
     $m .= "\n\t\t\t\tid='{$name}'";
     $m .= !$this->isEnabled() ? " readonly='readonly'" : "";
     if ($this->_style) {
         $m .= "\n\t\t\t\tstyle=\"" . str_replace("\"", "\\\"", $this->_style) . "\"";
     }
     if ($this->_onchange) {
         $m .= "\n\t\t\t\tonchange=\"" . str_replace("\"", "\\\"", $this->_onchange) . "\"";
     }
     if ($this->_value != null && $this->_value != $this->_startingDisplay) {
         $m .= ">" . htmlspecialchars($this->_value);
     } else {
         if ($this->_startingDisplay) {
             $v = htmlspecialchars($this->_startingDisplay, ENT_QUOTES);
             $m .= "\n\t\t\t\tonfocus='if (this.value == \"{$v}\") { this.value=\"\";   this.style.color=\"#000\";}'";
             $m .= "\n\t\t\t\tonblur='if (this.value == \"\") { this.value=\"{$v}\";  this.style.color=\"#888\";}'";
             $m .= " style='color: #888'>" . $v;
         } else {
             $m .= ">" . htmlspecialchars($this->_value);
         }
     }
     $m .= "</textarea>";
     $errText = $this->getErrorText();
     $errRule = $this->getErrorRule();
     $errStyle = $this->getErrorStyle();
     if ($errText && $errRule) {
         $m .= "<span id='" . $fieldName . "_error' style=\"padding-left: 10px; {$errStyle}\">&laquo; {$errText}</span>";
         $m .= Wizard::getValidationJavascript($fieldName, $errRule, $fieldName . "_error", $this->_showError);
         $this->_showError = false;
     }
     return $m;
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:47,代码来源:WTextArea.class.php

示例3: getMarkup

 /**
  * Returns a block of XHTML-valid code that contains markup for this specific
  * component. 
  * @param string $fieldName The field name to use when outputting form data or
  * similar parameters/information.
  * @access public
  * @return string
  */
 function getMarkup($fieldName)
 {
     ob_start();
     for ($i = 1; $i <= 2; $i++) {
         $name = RequestContext::name($fieldName . "_" . $i);
         $valProp = '_value' . $i;
         $value = $this->{$valProp};
         if ($i > 1) {
             print "\n\t\t<br/>";
         }
         print "<input type='password' \n\t\t\t\tname='{$name}' \n\t\t\t\tid='{$fieldName}' \n\t\t\t\tsize='" . $this->_size . "' maxlength='" . $this->_maxlength . "'" . (!$this->isEnabled() ? " readonly='readonly'" : "");
         if ($value != null) {
             print " value='" . htmlspecialchars($value, ENT_QUOTES) . "'";
         }
         if ($this->_style) {
             print "\n\t\t\t\tstyle=\"" . str_replace("\"", "\\\"", $this->_style) . "\"";
         }
         if ($this->_onchange) {
             print "\n\t\t\t\tonchange=\"" . str_replace("\"", "\\\"", $this->_onchange) . "\"";
         }
         print " />";
     }
     $errText = $this->getErrorText();
     $errRule = $this->getErrorRule();
     $errStyle = $this->getErrorStyle();
     if ($errRule && $errText) {
         print "\n\t\t<span id='" . $fieldName . "_error' style=\"padding-left: 10px; {$errStyle}\">&laquo; {$errText}</span>";
         print Wizard::getValidationJavascript($fieldName, $errRule, $fieldName . "_error", $this->_showError);
         $this->_showError = false;
     }
     if ($this->_showEqualityError == true) {
         $errText = dgettext("polyphony", "Passwords must match.");
         print "\n\t\t<span id='" . $fieldName . "_error' style=\"padding-left: 10px; {$errStyle}\">&laquo; {$errText}</span>";
         $this->_showEqualityError = false;
     }
     return ob_get_clean();
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:45,代码来源:WPasswordPair.class.php


注:本文中的Wizard::getValidationJavascript方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。