php - I want to get value from fields loop .How can I do? -
i'm using joomla , have begun develop web app, want values form fields. use $_post page didn't work.
this default.php >>>
<?php defined('_jexec') or die; jhtml::_('behavior.keepalive'); jhtml::_('behavior.tooltip'); jhtml::_('behavior.formvalidation'); ?> <div class="item" <?php echo $this->pageclass_sfx?>"> <?php if ($this->params->get('show_page_heading')) : ?> <h1><?php echo $this->escape($this->params->get('page_heading')); ?></h1> <?php endif; ?> <form id="add-item" action="<?php echo jroute::_('index.php?option=com_stationery&task=item.save'); ?>" method="post" class="form-validate" enctype="multipart/form-data"> <?php foreach ($this->form->getfieldsets() $fieldset): // iterate through form fieldsets , display each one.?> <?php $fields = $this->form->getfieldset($fieldset->name);?> <?php if (count($fields)):?> <fieldset> <?php if (isset($fieldset->label)):// if fieldset has label set, display legend. ?> <legend><?php echo jtext::_($fieldset->label);?></legend> <?php endif;?> <dl> <?php foreach($fields $field):// iterate through fields in set , display them.?> <?php if ($field->hidden):// if field hidden, display input.?> <?php echo $field->input;?> <?php else:?> <dt> <?php echo $field->label; // show label registor ?> <?php if (!$field->required && $field->type!='spacer'): ?> <?php endif; ?> </dt> <dd><?php echo ($field->type!='spacer') ? $field->input : " "; ?></dd> <?php endif;?> <?php endforeach;?> </dl> </fieldset> <?php endif;?> <?php endforeach;?> <div> <button name="save" type="submit" class="btn btn-success" class="validate"><?php echo jtext::_('save');?></button> <?php echo jtext::_('or');?> <a class="btn btn-danger" href="<?php echo jroute::_('/stationery/index.php/add-items');?>" title="<?php echo jtext::_('jcancel');?>"><?php echo jtext::_('jcancel');?></a> <input type="hidden" name="option" value="com_stationery" /> <input type="hidden" name="task" value="item.save" /> <?php echo jhtml::_('form.token');?> </div> </form> <script>
this loop field.xml show each field. want value in inputbox. can javascript variable can't use save in table. want php variable ($....). how can it? please me. thank you
in joomla 2.5+ use jrequest, since it's deprecated should:
jfactory::getapplication()->input->get...
however looking @ code there may simpler approach bind input table model
Comments
Post a Comment