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


PHP FormValidator::getJsValidation方法代码示例

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


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

示例1: displayAddForm

 /**
  * displayAddForm
  *
  * Displays the form for adding an address.
  *
  * @return void
  */
 function displayAddForm()
 {
     $country_list = buildCountryList();
     $selected = getDefaultCountry();
     $country_options = buildHtmlSelectOptions($country_list, $selected);
     $validator = new FormValidator();
     // TODO
     // Make this a removable alert message (part of Alerts table)
     echo '
         <form id="addressbook_form" action="addressbook.php" method="post">
             <p class="info-alert">
                 ' . T_('Please only add addresses for Non-members. Anyone who is a member of this website must add/update their own address.') . '
             </p>
             <fieldset>
                 <legend><span>' . T_('Add Address') . '</span></legend>
                 <div class="field-row">
                     <div class="field-label"><label for="fname"><b>' . T_('First Name') . '</b></label></div>
                     <div class="field-widget"><input class="frm_text" type="text" name="fname" id="fname" size="25"/></div>
                 </div>
                 <div class="field-row">
                     <div class="field-label"><label for="lname"><b>' . T_('Last Name') . '</b></label></div>
                     <div class="field-widget"><input class="frm_text" type="text" name="lname" id="lname" size="25"/></div>
                 </div>
                 <div class="field-row">
                     <div class="field-label"><label for="email"><b>' . T_('Email') . '</b></label></div>
                     <div class="field-widget"><input class="frm_text" type="text" name="email" id="email" size="50"/></div>
                 </div>
                 <div class="field-row">
                     <div class="field-label"><label for="country"><b>' . T_('Country') . '</b></label></div>
                     <div class="field-widget">
                         <select name="country" id="country">
                             <option></option>
                             <option value="US">' . T_('UNITED STATES') . '</option>
                             <option>------</option>
                             ' . $country_options . '
                         </select>
                     </div>
                 </div>
                 <div class="field-row">
                     <div class="field-label"><label for="address"><b>' . T_('Street Address') . '</b></label></div>
                     <div class="field-widget"><input class="frm_text" type="text" name="address" id="address" size="25"/></div>
                 </div>
                 <div class="field-row">
                     <div class="field-label"><label for="city"><b>' . T_('City') . '</b></label></div>
                     <div class="field-widget"><input class="frm_text" type="text" name="city" id="city" size="50"/></div>
                 </div>
                 <div class="field-row">
                     <div class="field-label"><label for="state"><b>' . T_('State') . '</b></label></div>
                     <div class="field-widget"><input class="frm_text" type="text" name="state" id="state" size="50"/></div>
                 </div>
                 <div class="field-row">
                     <div class="field-label"><label for="zip"><b>' . T_('Zip Code') . '</b></label></div>
                     <div class="field-widget"><input class="frm_text" type="text" name="zip" id="zip" size="10"/></div>
                 </div>
                 <div class="field-row">
                     <div class="field-label"><label for="home"><b>' . T_('Home Phone') . '</b></label></div>
                     <div class="field-widget"><input class="frm_text" type="text" name="home" id="home" size="20"/></div>
                 </div>
                 <div class="field-row">
                     <div class="field-label"><label for="work"><b>' . T_('Work Phone') . '</b></label></div>
                     <div class="field-widget"><input class="frm_text" type="text" name="work" id="work" size="20"/></div>
                 </div>
                 <div class="field-row">
                     <div class="field-label"><label for="cell"><b>' . T_('Cell Phone') . '</b></label></div>
                     <div class="field-widget"><input class="frm_text" type="text" name="cell" id="cell" size="20"/></div>
                 </div>
                 <div class="field-row">
                     <div class="field-label"><label for="private"><b>' . T_('Private') . '</b></label></div>
                     <div class="field-widget"><input type="checkbox" name="private" id="private"/></div>
                 </div>
                 <p>
                     <input class="sub1" type="submit" name="addsubmit" value="' . T_('Add') . '"/> 
                     ' . T_('or') . ' 
                     <a href="addressbook.php">' . T_('Cancel') . '</a>
                 </p>
             </fieldset>
             ' . $validator->getJsValidation($this->getProfile('add')) . '
         </form>';
 }
开发者ID:lmcro,项目名称:fcms,代码行数:86,代码来源:addressbook_class.php

示例2: displayCreateUserForm


//.........这里部分代码省略.........
     $dayList = array();
     $i = 1;
     while ($i <= 31) {
         $dayList[$i] = $i;
         $i++;
     }
     $monthList = array();
     $i = 1;
     while ($i <= 12) {
         $monthList[$i] = getMonthAbbr($i);
         $i++;
     }
     $validator = new FormValidator();
     echo '
     <form action="familytree.php?create=submit" method="post">
         <fieldset class="relationship-form">
             <legend><span>' . $legend . '</span></legend>
             <div class="cols">
                 <div>
                     <label for="fname"><b>' . T_('First Name') . '</b></label><br/>
                     <input class="frm_text" type="text" name="fname" id="fname" size="25"/>
                 </div>
                 <div>
                     <label for="mname"><b>' . T_('Middle Name') . '</b></label><br/>
                     <input class="frm_text" type="text" name="mname" id="mname" size="25"/>
                 </div>
                 <div>
                     <label for="lname"><b>' . T_('Last Name') . '</b></label><br/>
                     <input class="frm_text" type="text" name="lname" id="lname" size="25"/>
                 </div>
             </div>';
     // don't show maiden name unless it's needed
     if ($sex == 'F' || $sex == '?') {
         echo '
             <p class="maiden-name">
                 <label for="maiden"><b>' . T_('Maiden Name') . '</b></label><br/>
                 <input class="frm_text" type="text" name="maiden" id="maiden" size="25"/>
             </p>';
     }
     // We don't know the sex of the child or spouse, but we do for all other relationships
     if ($sex === '?') {
         echo '
             <p>
                 <label><b>' . T_('Sex') . '</b></label><br/>
                 <select id="sex" name="sex">
                     ' . buildHtmlSelectOptions(array('M' => T_('Male'), 'F' => T_('Female')), '-1') . '
                 </select>
             </p>';
     } else {
         echo '<div><input type="hidden" id="sex" name="sex" value="' . $sex . '"/></div>';
     }
     echo '
             <p id="living_deceased" style="display:none;">
                 <label for="living_option" class="radio_label">
                     <input type="radio" id="living_option" name="living_deceased_options" checked="checked" value="1"/>
                     ' . T_('Living') . '
                 </label>
                 &nbsp; &nbsp; &nbsp;
                 <label for="deceased_option" class="radio_label">
                     <input type="radio" id="deceased_option" name="living_deceased_options" value="1"/>
                     ' . T_('Deceased') . '
                 </label>
             </p>
             <div class="dob_dod">
                 <div class="half">
                     <label for="day"><b>' . T_('Birthday') . '</b></label><br/>
                     <select id="bday" name="bday">
                         <option value="">' . T_('Day') . '</option>
                         ' . buildHtmlSelectOptions($dayList, "") . '
                     </select>
                     <select id="bmonth" name="bmonth">
                         <option value="">' . T_('Month') . '</option>
                         ' . buildHtmlSelectOptions($monthList, "") . '
                     </select>
                     <input class="frm_text" type="text" name="byear" id="byear" size="5" maxlength="4" placeholder="' . T_('Year') . '"/>
                 </div>
                 <div id="deceased" class="half">
                     <label for="day"><b>' . T_('Date Deceased') . '</b></label><br/>
                     <select id="dday" name="dday">
                         <option value="">' . T_('Day') . '</option>
                         ' . buildHtmlSelectOptions($dayList, "") . '
                     </select>
                     <select id="dmonth" name="dmonth">
                         <option value="">' . T_('Month') . '</option>
                         ' . buildHtmlSelectOptions($monthList, "") . '
                     </select>
                     <input class="frm_text" type="text" name="dyear" id="dyear" size="5" maxlength="4" placeholder="' . T_('Year') . '"/>
                 </div>
             </div>
             ' . $options . '
             ' . $validator->getJsValidation($this->getProfile('create')) . '
             <p>
                 <input type="hidden" id="id" name="id" value="' . $userId . '"/>
                 <input type="hidden" id="type" name="type" value="' . cleanOutput($type) . '"/>
                 <input class="sub1" type="submit" id="submit" name="submit" value="' . T_('Add') . '"/> &nbsp;
                 <a href="familytree.php?view=' . $this->currentTreeUserId . '">' . T_('Cancel') . '</a>
             </p>
         </fieldset>
     </form>';
 }
开发者ID:lmcro,项目名称:fcms,代码行数:101,代码来源:FamilyTree.php


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