我在配送方式的模板文件中添加了一个下拉框。现在我想让它成为必填字段。我已经尝试了很多方法。但没有奏效。任何帮助将不胜感激。
下面是模板文件。
<?php
$_code=$this->getMethodCode();
$carrier = $this->getMethodInstance();
$pickupData = $this->getQuote()->getPickupData();
$_rate = $this->getRate();
if(!isset($pickupData['store']))
{
$pickupData['store'] = -1;
}
if(!isset($pickupData['name']))
{
$pickupData['name'] = '';
}
?>
<ul class="form-list" id="shipping_form_<?php echo $_rate->getCode() ?>" style="display:none;">
<li>
<label for="shipping_pickup[store]" class="required"><em>*</em><?php echo $this->__('Choose Store Location:') ?></label>
<span class="input-box" style="float:left ;">
<select class="required-entry" name="shipping_pickup[store]" id="shipping_pickup[store]">
<option value='0'><?php echo $this->__('Select Store..');?></option>
<?php
$collection = $this->getAllLocations();
foreach($collection as $coll)
{
$data = $coll->getData();
?>
<option value='<?php echo $data['location_id']; ?>'><?php echo $this->__($data['location_name']);?></option>
<?php
}
?>
</select>
</span>
</li>
</ul>