Hello!
I have multiplier container which dublicate on button plus container with field
Param multiplier containe:
Replacer is __N___
Counter 1
Hide First YES
Disable First YES
Hide Buttons YES
Start Count 1
Code Button Plus in custom code in multiplier container:
Help plz!!!
How can do than Replacer __N__ be > 10 button plus is not visible and i can't click more field?
I have multiplier container which dublicate on button plus container with field
Param multiplier containe:
Replacer is __N___
Counter 1
Hide First YES
Disable First YES
Hide Buttons YES
Start Count 1
Code Button Plus in custom code in multiplier container:
<span class="btn btn-success btn-sm multiplier-add-button"><i class="fa fa-plus fa-lg"></i></span>
Help plz!!!
How can do than Replacer __N__ be > 10 button plus is not visible and i can't click more field?
Hi webkruter,
I did this for a client using jQuery a while ago. Here is the part of the code that checks the number of lines displayed and hides the + button when it gets to max_quantity
Note that this allows for the fact that some lines may be deleted and new ones added.
Bob
I did this for a client using jQuery a while ago. Here is the part of the code that checks the number of lines displayed and hides the + button when it gets to max_quantity
jQ('#garment_multiplier .multiplier-add-button').click(calculate);
calculate();
function calculate(){
var quantity, base_price, material_colour, name_back, max_quantity;
max_quantity = 5;
// get the quantity of shirts
name_back = jQ('#garment_multiplier :input').filter('.name_back');
quantity = parseInt(name_back.length) - 1;
quantity = Math.max(quantity, 1);
jQ('#quantity').val(quantity);
if ( quantity >= ( parseInt(max_quantity) - 1 ) ) {
jQ('#garment_multiplier .multiplier-add-button').hide();
} else {
jQ('#garment_multiplier .multiplier-add-button').show();
}
. . .
}
This uses one of the inputs in the multiplier - 'name_back' - and counts the number of those that are inside the multiplier; then subtracts 1 because one line is hidden.
Note that this allows for the fact that some lines may be deleted and new ones added.
Bob
Big Tnx GreyHead!!!! Can help how to realese whis code?
Insert into custom code in multiplier comtainer? Or JC code on load or make function?
If you have example .cf5bak it be VERY NICE!
Insert into custom code in multiplier comtainer? Or JC code on load or make function?
If you have example .cf5bak it be VERY NICE!
Hi, GreyHead
Thanks for your answer, base on your information I am trying to embed the code by Load JavaScript function in Step-->On load. But from your code there is "garment_multiplier" before multiplier-add-button. May I know what is that?
Many thanks
Thanks for your answer, base on your information I am trying to embed the code by Load JavaScript function in Step-->On load. But from your code there is "garment_multiplier" before multiplier-add-button. May I know what is that?
Many thanks
if (typeof jQuery != 'undefined' ) {
jQuery.noConflict();
}
jQ('#btn.btn-success.btn-sm.multiplier-add-button').click(calculate);
calculate();
function calculate(){
var quantity, base_price, material_colour, name_back, max_quantity;
max_quantity = 5;
// get the quantity of shirts
name_back = jQ('#btn.btn-success.btn-sm.multiplier-add-button:input').filter('.name_back');
quantity = parseInt(name_back.length) - 1;
quantity = Math.max(quantity, 1);
jQ('#quantity').val(quantity);
if ( quantity >= ( parseInt(max_quantity) - 1 ) ) {
jQ('#btn.btn-success.btn-sm.multiplier-add-button').hide();
} else {
jQ('#btn.btn-success.btn-sm.multiplier-add-button').show();
}
}
This topic is locked and no more replies can be posted.