1. <legend id='rhMpA'><style id='rhMpA'><dir id='rhMpA'><q id='rhMpA'></q></dir></style></legend>

      <i id='rhMpA'><tr id='rhMpA'><dt id='rhMpA'><q id='rhMpA'><span id='rhMpA'><b id='rhMpA'><form id='rhMpA'><ins id='rhMpA'></ins><ul id='rhMpA'></ul><sub id='rhMpA'></sub></form><legend id='rhMpA'></legend><bdo id='rhMpA'><pre id='rhMpA'><center id='rhMpA'></center></pre></bdo></b><th id='rhMpA'></th></span></q></dt></tr></i><div id='rhMpA'><tfoot id='rhMpA'></tfoot><dl id='rhMpA'><fieldset id='rhMpA'></fieldset></dl></div>
    2. <tfoot id='rhMpA'></tfoot>

      <small id='rhMpA'></small><noframes id='rhMpA'>

          <bdo id='rhMpA'></bdo><ul id='rhMpA'></ul>

        填写 joomla 的表单域

        Fill joomla#39;s form field(填写 joomla 的表单域)

              <tbody id='rH7EH'></tbody>

            <small id='rH7EH'></small><noframes id='rH7EH'>

              <i id='rH7EH'><tr id='rH7EH'><dt id='rH7EH'><q id='rH7EH'><span id='rH7EH'><b id='rH7EH'><form id='rH7EH'><ins id='rH7EH'></ins><ul id='rH7EH'></ul><sub id='rH7EH'></sub></form><legend id='rH7EH'></legend><bdo id='rH7EH'><pre id='rH7EH'><center id='rH7EH'></center></pre></bdo></b><th id='rH7EH'></th></span></q></dt></tr></i><div id='rH7EH'><tfoot id='rH7EH'></tfoot><dl id='rH7EH'><fieldset id='rH7EH'></fieldset></dl></div>
              <tfoot id='rH7EH'></tfoot>
                <bdo id='rH7EH'></bdo><ul id='rH7EH'></ul>
                • <legend id='rH7EH'><style id='rH7EH'><dir id='rH7EH'><q id='rH7EH'></q></dir></style></legend>

                  本文介绍了填写 joomla 的表单域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个用 joomla 制作的简单表格.我有两个电子邮件字段:

                  i have a simple form made with joomla. I have two fields for email:

                  echo $this->form->getLabel('email1');
                  echo $this->form->getInput('email1');
                  
                  echo $this->form->getLabel('email2');
                  echo $this->form->getInput('email2');
                  

                  当用户已经登录时,我正在尝试填写这些字段,但我遇到了问题.这是代码:

                  i'm trying to fill those fields when the user is allready logged in, but i have a issue. here is the code:

                  $user = JFactory::getUser();
                  $login = false;
                  if(!$user->get('guest')){
                      $login = true;
                      $email = $user->email;
                  }
                  ...
                  echo '<input type="text" name="jform[email1]" class="validate-email required" id="jform_email1" value="'.$email.'" size="30" required="required" aria-required="true" disabled/><br>';
                  echo '<input type="hidden" name="jform[email2]" class="validate-email required" id="jform_email2" value="'.$email.'" size="30" required="required" aria-required="true" disabled/>';
                  

                  在输出中,字段的类型更改为

                  In the output, the fields's type change to

                  <input type="email" name="jform[email1]" class="validate-email required" id="jform_email1" value="mail@mymail.com" size="30" required="required" aria-required="true" disabled="">
                  <input type="email" name="jform[email2]" class="validate-email required" id="jform_email2" value="mail@mymail.com" size="30" required="required" aria-required="true" disabled="">
                  

                  我只想禁用这些字段并隐藏第二个字段

                  I just want to disabled those fields and hide the second field

                  感谢您的帮助

                  推荐答案

                  我找到了答案,希望对某人有所帮助:

                  I found the answer, hope that will help someone:

                  echo $this->form->getLabel('email1');
                  $this->form->setValue('email1',null,$email);
                  $this->form->setFieldAttribute( 'email1', 'readonly', 'true' );
                  echo $this->form->getInput('email1');
                  
                  echo $this->form->getLabel('email2', array('style' => 'display:none;'));
                  $this->form->setValue('email2',null,$email);
                  $this->form->setFieldAttribute( 'email2', 'readonly', 'true' );
                  echo $this->form->getInput('email2', array('type' => 'hidden'));
                  

                  这篇关于填写 joomla 的表单域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is Joomla 2.5 much faster than Joomla 1.5 Querywise(Joomla 2.5 比 Joomla 1.5 Querywise 快得多吗)
                  How to share Joomla login session from one joomla website to one ASP.Net MVC website(如何将 Joomla 登录会话从一个 joomla 网站共享到一个 ASP.Net MVC 网站)
                  htaccess redirect root to subdirectory but allow index.php in root AND query strings to function(htaccess 将根重定向到子目录,但允许根和查询字符串中的 index.php 起作用)
                  Joomla include database functions(Joomla 包含数据库功能)
                  nl2br() not working when displaying SQL results(显示 SQL 结果时 nl2br() 不起作用)
                  Joomla 2.5 JFactory::getSession(); seems to be caching in firefox(Joomla 2.5 JFactory::getSession();似乎在 Firefox 中缓存)

                  <i id='Mbk0N'><tr id='Mbk0N'><dt id='Mbk0N'><q id='Mbk0N'><span id='Mbk0N'><b id='Mbk0N'><form id='Mbk0N'><ins id='Mbk0N'></ins><ul id='Mbk0N'></ul><sub id='Mbk0N'></sub></form><legend id='Mbk0N'></legend><bdo id='Mbk0N'><pre id='Mbk0N'><center id='Mbk0N'></center></pre></bdo></b><th id='Mbk0N'></th></span></q></dt></tr></i><div id='Mbk0N'><tfoot id='Mbk0N'></tfoot><dl id='Mbk0N'><fieldset id='Mbk0N'></fieldset></dl></div>
                      <tbody id='Mbk0N'></tbody>
                    • <bdo id='Mbk0N'></bdo><ul id='Mbk0N'></ul>

                          <tfoot id='Mbk0N'></tfoot>

                        • <legend id='Mbk0N'><style id='Mbk0N'><dir id='Mbk0N'><q id='Mbk0N'></q></dir></style></legend>

                            <small id='Mbk0N'></small><noframes id='Mbk0N'>