Difference between revisions of "How to use predefined list of quantity instead of text input field on signup form"

From aMember Pro Documentation
Jump to: navigation, search
(Created page with "Please edit your signup form at ''aMember CP -> Forms Editor -> (edit)'' and add Javascript brick to your form. Then click configure link on this brick and put the following ...")
 
Line 1: Line 1:
Please edit your signup form at
+
First of all you need to enable option 'allow user to change quantity' in product settings.
 +
''aMember CP -> Products -> Manage Products -> (edit)''
 +
 
 +
You need edit your signup form at
 
''aMember CP -> Forms Editor -> (edit)''
 
''aMember CP -> Forms Editor -> (edit)''
 
and add Javascript brick to your form.
 
and add Javascript brick to your form.
  
Then click configure link on this brick and put the following code in brick configuration:
+
Then click ''configure'' link on this brick and put the following code in brick configuration:
 
<source>
 
<source>
 
jQuery(function($){
 
jQuery(function($){

Revision as of 06:34, 14 December 2016

First of all you need to enable option 'allow user to change quantity' in product settings. aMember CP -> Products -> Manage Products -> (edit)

You need edit your signup form at aMember CP -> Forms Editor -> (edit) and add Javascript brick to your form.

Then click configure link on this brick and put the following code in brick configuration:

jQuery(function($){
    $('[for=product-5-5]').after('<hr />');
});
jQuery(function(){
    jQuery('.am-product-qty').css({opacity: 0, width: 0, padding:0}).after('<select>\
        <option value="1">1</option>\
        <option value="2">2</option>\
        <option value="3">3</option>\
        <option value="4">4</option>\
        <option value="5">5</option>\
    </select>').next('select').change(function(){
        jQuery('.am-product-qty', jQuery(this).closest('label')).val(jQuery(this).val()).change();
    });
});

Save your form and test it.