Jump to content

Checkout custom field, required when paymentmethod selected


JelleG

Recommended Posts

Hi,

 

I created a custom field, that I only want to display when a payment method is selected.

That works fine with the following code. But I set the input fields a required in the admin panel.

But it should only be required when the payment method is selected.

 

How can I modify this, so that it only become required when selected?

 

HTML:

 

<div id="ccinputform" class="iban-number" {if $selectedgatewaytype neq "banktransfer"} style="display:none;"{/if}>

{foreach key=num item=customfield from=$customfields}

<div class="row">

<div class="col-md-12">

<div class="form-group form-group-xl">

<label class="control-label" for="customfield{$customfield.id}">{$customfield.name}</label>

{$customfield.input|replace:'>' : 'placeholder="IBAN nummer" class="form-control" >'}

<span id="helpBlock" class="help-block"></span>

</div>

</div>

</div>

{/foreach}

</div>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated