php - How to make Image Upload Required -
how can section of code made compulsory/required? code doesn't have simple image upload field. joomla component. have tried specifying attribute "required" regular html upload fields, has not worked.
<section class="block" id="gallery"> <h2><?php echo jtext::_('com_bt_property_gallery');?></h2> <div class="center"> <div class="form-group"> <?php if ($this->params->get('fe_upload_type', 1) == 1) { echo $this->loadtemplate('images_flash'); } else { echo $this->loadtemplate('images_simple'); } ?> <?php $params = new jregistry(); if ($this->item->params) { $params->loadarray($this->item->params); } $thumb_height = $params->get('thumb_height', $this->params->get("thumb_height", 180)); $thumb_width = $params->get('thumb_width', $this->params->get("thumb_width", 336)); if ($thumb_height > 100) { $thumb_width = floor($thumb_width * 100 / $thumb_height); $thumb_height = 100; } $thumbimgprocess = $this->params->get('thumbimgprocess', $this->params->get("thumbimgprocess", 1)); ?> <ul id="sortable"> <?php if (is_array($this->images)) { foreach ($this->images $image) { ?> <li title="double-click make default image" <?php if ($image->default) echo 'class="default_image"' ?>><input class="input-default" <?php if ($image->default) echo 'checked="checked"' ?> title="make default" name="default_image" type="radio" value="<?php echo $image->filename ?>" /> <img class="img-thumb" src="<?php echo juri::root() . $path . '/' . $this->item->id . '/' . ($this->params->get('thumbimgprocess', 1) == -1 ? 'original' : 'thumb') . '-' . $image->filename; ?>" /> <input type="hidden" name="image_id[]" value="<?php echo $image->id ?>" /> <?php if ($image->youembed != '') { ?> <img class="img_video" src="../components/com_bt_property/assets/img/video.png" /> <?php } ?> <input type="hidden" name="image_filename[]" value="<?php echo $image->filename ?>" /> <br /> <a href="javascript:void(0)" class="edit" onclick="editimage(this)"><?php echo jtext::_('com_bt_property_edit');?></a> <a href="javascript:void(0)" class="remove" onclick="removeimage(this)"><?php echo jtext::_('com_bt_property_remove');?></a> </li> <?php } ?> <input type="hidden" id="property-hidden" name="video" value="<?php echo htmlspecialchars(json_encode($this->images)); ?>" /> <?php } ?> </ul> <a href="#" class="button" onclick="return removeall()"><?php echo jtext::_('com_bt_property_clear_all');?></a> </div> </div> <p style = "color:red;"> "note: files must not contain form of contact details; names, phone no, email, address, company, website , on. designs such content not approved posting" </p> </section>
i found source code simple image upload button linked above code. had specify required usual, before closing (>) file input tag.
Comments
Post a Comment