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 的表单域

        时间:2023-10-15

              <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 的表单域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:向 joomla MVC 列表视图中的每个项目添加相关数据的计数 下一篇:Joomla 3.1 介绍图片作为阅读更多链接

                  相关文章

                  <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>
                    • <bdo id='Mbk0N'></bdo><ul id='Mbk0N'></ul>

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

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

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