I am using the built-in Magento form validation to ensure the user makes a selection on a particular group of radio boxes.
The code below looks fine however
<div class="input-box">
<li class="control">
<input type="radio" class="radio organisation_type" value="1" id="billing:organisation_type_1" name="billing[organisation_type]"> <?php echo $this->__('School') ?></li>
<li class="control">
<input type="radio" class="radio organisation_type" value="2" id="billing:organisation_type_2" name="billing[organisation_type]"> <?php echo $this->__('Parent') ?></li>
<li class="control">
<input type="radio" class="radio validate-one-required organisation_type" value="3" id="billing:organisation_type_3" name="billing[organisation_type]"> <?php echo $this->__('Business') ?></li>
</div>
I am using the validate-one method on the class on the last radio box
For some reason the code above will only let me proceed if I select the last radio box?? Can anyone explain why if I check either the first or second box the validation is still failing?
I am using the built-in Magento form validation to ensure the user makes a selection on a particular group of radio boxes.
The code below looks fine however
<div class="input-box">
<li class="control">
<input type="radio" class="radio organisation_type" value="1" id="billing:organisation_type_1" name="billing[organisation_type]"> <?php echo $this->__('School') ?></li>
<li class="control">
<input type="radio" class="radio organisation_type" value="2" id="billing:organisation_type_2" name="billing[organisation_type]"> <?php echo $this->__('Parent') ?></li>
<li class="control">
<input type="radio" class="radio validate-one-required organisation_type" value="3" id="billing:organisation_type_3" name="billing[organisation_type]"> <?php echo $this->__('Business') ?></li>
</div>
I am using the validate-one method on the class on the last radio box
For some reason the code above will only let me proceed if I select the last radio box?? Can anyone explain why if I check either the first or second box the validation is still failing?
Share Improve this question edited May 28, 2014 at 13:28 Zabs asked May 28, 2014 at 13:10 ZabsZabs 14.2k51 gold badges179 silver badges311 bronze badges 6- Does this post help?? – eyoung100 Commented May 28, 2014 at 13:24
- thanks but still no joy :( – Zabs Commented May 28, 2014 at 13:26
-
try adding:
class="radio validate-one-required organisation_type"
to all 3 – eyoung100 Commented May 28, 2014 at 13:29 -
try
validate-one-required-by-name
for all radio buttons – MeenakshiSundaram R Commented May 28, 2014 at 13:30 - neither of them work.. this is really bizarre.. i hate Magento sometimes – Zabs Commented May 28, 2014 at 13:33
2 Answers
Reset to default 6You need to add validate-one-required-by-name
to the last radio button.
<input type='radio' class="validate-one-required-by-name .. "
Take a look at Payment Method
when placing an admin order
You can't use the same ID in any case. Make your input id
attributes always different.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744801290a4594504.html
评论列表(0条)