We help IT Professionals succeed at work.

Javascript - what is an echo function

elliottbenzle
on
I am dealing with a component that builds a list form using javascript. I need to add a message above one of the message fields. The developer told me that I need to add an "echo function" to a certain file, to create the message. I was wondering if someone could tell me what an 'echo function' is?

The page I'm working on is here: http://75.98.228.10/onlinestore/member-sign-up/index.php?option=com_osemsc&view=register&Itemid=89
and I want to add my message where the field 'renewal description' is located.

The code that builds the form is here:

<?php
/**
  * @version     5.0 +
  * @package        Open Source Membership Control - com_osemsc
  * @subpackage    Open Source Access Control - com_osemsc
  * @author        Open Source Excellence (R) {@link  http://www.opensource-excellence.com}
  * @author        Created on 15-Nov-2010
  * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
  *
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *  @Copyright Copyright (C) 2010- Open Source Excellence (R)
*/

defined('_JEXEC') or die("Direct Access Not Allowed");
$error_msg = "";
oseHTML::script(oseMscMethods::getJsModPath('regOS','reg'),'1.5');
echo $this->initJs();
?>
<style type="text/css">
      .combo-left      {
            text-align: left
      }

</style>

<script type="text/javascript">
Ext.onReady(function(){
      var headerObjs = <?php echo oseJson::encode($this->registerOS_header);?>;
      var bodyObjs = <?php echo oseJson::encode($this->registerOS_body);?>;
      var footerObjs = <?php echo oseJson::encode($this->registerOS_footer);?>;

      var oseViewRegfp = oseMsc.reg.buildForm(Ext.get('osemsc-reg').getWidth()*2);

      oseMsc.reg.fp = new oseMsc.payment.form(oseViewRegfp);


      oseMsc.reg.fp.addReader = function()      {
            this.fp.getForm().reader = new Ext.data.JsonReader({
                root: 'results'
                ,totalProperty: 'total'
                ,idProperty: 'id'
                ,fields:[
                      {name: 'msc_id', type: 'string', mapping: 'msc_id'}
                      ,{name: 'msc_option', type: 'string', mapping: 'msc_option'}
                      ,{name: 'ose_currency', type: 'string', mapping: 'ose_currency'}
                    ]
              })
      }

      oseMsc.reg.fp.addReader()

      oseMsc.reg.fp.onLoadAddons(headerObjs,'regHeader',true);
      oseMsc.reg.fp.onLoadAddons(bodyObjs,'regBody',true);
      oseMsc.reg.fp.onLoadAddons(footerObjs,'regFooter',true);
      oseMsc.reg.fp.setClickBtnAction('submitBtnOk');
      oseMsc.reg.fp.setBtnActive('submitBtnOk',false);
      oseMsc.reg.fp.render('osemsc-reg');

      //oseMsc.reg.fp.setMscList();
      oseMsc.reg.fp.loadRegInfo();
      //alert(oseMscAddon.terms);

});

</script>

<?php
      if($this->menuParams->get('show_page_heading') || $this->menuParams->get('show_page_title'))
      {
?>
            <div class='componentheading <?php echo $this->menuParams->get('pageclass_sfx'); ?>'><?php echo $this->menuParams->get('page_heading'); ?></div>
<?php
      }
?>

<div id="osemsc-reg-heading">

<div class="message-box">
<div class="message-heading">Membership Instructions</div>

<strong>Renewals</strong><br />

If you are renewing your membership please enter your member number in the "Member Number" field. New members can leave this field blank.
<br />
If you do not know your member number, <a href="../../index.php?option=com_userlist" target="_blank" >click here to search the member number database</a>.<br />
If you do not find your member number in the database, Email membership@readingrecovery.org or call 614-310-7322.<br /><br />

<strong>For Gift Memberships</strong><br />
If you are purchasing a gift membership, please enter the recipient's name and
 preferred address (either work or home).  Please list the new member's job title,
 then proceed to the Sponsors and Gift Memberships section.<br /><br />

<strong>Mailing List</strong><br />
Occasionally we make our mailing list available to carefully selected companies.  If you do not wish to have your name included, please check "No" for the question "Do you want to be included on our mailing list?" at the bottom of the form.
 </div>
</div>

<div id="osemsc-reg"></div>

<div id="ose-payment-callback-form"></div>
<?php include(JPATH_COMPONENT.DS."views".DS."footer.php"); ?>
Comment
Watch Question

Commented:
echo is used to print output.

http://www.tizag.com/phpT/echo.php

Author

Commented:
Thanks. That was a pretty long question for being one of the first functions that anyone learns. I need to get away from the computer : )

Explore More ContentExplore courses, solutions, and other research materials related to this topic.