Hello Viotax
on product page when checkbox tick it will display the textbox then what is next .
Thanks
sachin
on product page when checkbox tick it will display the textbox then what is next .
Thanks
sachin
Hi sachin,sachin6609 wrote: ↑Tue Aug 22, 2017 9:10 pmHello Viotax
on product page when checkbox tick it will display the textbox then what is next .
Thanks
sachin
For example when you tick name's checkbox, one textbox appears for write name on it.
You understand now ?
Thank you
I need exactly that when
- Name's checkbox (option 8, value 31) ticked, name's textbox (option 11) appears.
- Number's checkbox (option 8, value 32) ticked, number's textbox (option 12) appears.
Someone can help me ?
Thank you so much !
- Name's checkbox (option 8, value 31) ticked, name's textbox (option 11) appears.
- Number's checkbox (option 8, value 32) ticked, number's textbox (option 12) appears.
Someone can help me ?
Thank you so much !
Hi,
You can do it with jquery:
Demo:
https://jsfiddle.net/sabeti05/rzshasbz/
You can do it with jquery:
Code: Select all
$(function(){
var checkbox = '[name^="option[234]"][value="24"]';
var textBox = '[name="option[236]"]';
$(checkbox).on('change', function(){
if($(this).is(':checked')){
$(textBox).parent().show();
} else {
$(textBox).parent().hide();
}
});
$(checkbox).trigger('change');
});
Demo:
https://jsfiddle.net/sabeti05/rzshasbz/
Hi,DigitCart wrote: ↑Wed Aug 23, 2017 12:06 pmHi,
You can do it with jquery:
Code: Select all
$(function(){ var checkbox = '[name^="option[234]"][value="24"]'; var textBox = '[name="option[236]"]'; $(checkbox).on('change', function(){ if($(this).is(':checked')){ $(textBox).parent().show(); } else { $(textBox).parent().hide(); } }); $(checkbox).trigger('change'); });
Demo:
https://jsfiddle.net/sabeti05/rzshasbz/
I need to edit product.tpl? And when ?
Sorry I'm badly
Yes, add that code to the end of your product.tpl
inside an exiting script tag. or create a new script tag:
You must change these numbers, according to your options:
inside an exiting script tag. or create a new script tag:
Code: Select all
<script>
Here put the code
</script>
Code: Select all
var checkbox = '[name^="option[234]"][value="24"]';
var textBox = '[name="option[236]"]';
Thank you and for add another of this ? Because I need to make this :DigitCart wrote: ↑Wed Aug 23, 2017 5:51 pmYes, add that code to the end of your product.tpl
inside an exiting script tag. or create a new script tag:You must change these numbers, according to your options:Code: Select all
<script> Here put the code </script>
Code: Select all
var checkbox = '[name^="option[234]"][value="24"]'; var textBox = '[name="option[236]"]';
I need exactly that when
- Name's checkbox (option 8, value 31) ticked, name's textbox (option 11) appears.
- Number's checkbox (option 8, value 32) ticked, number's textbox (option 12) appears.
Hi, Viotax10 can I ask you the reason that you want do this?
Opencart Developer - For custom work and support contact @ webcorvo@gmail.com
Hello,
This will work for all your products:
Demo: https://jsfiddle.net/sabeti05/4dgt2bb1/
This will work for all your products:
Code: Select all
<script>
$(function(){
$('#product .checkbox:contains(Name) input[type="checkbox"]').change(function(){
if($(this).is(':checked')){
$('#product input[placeholder="Name"]').parent().fadeIn();
} else {
$('#product input[placeholder="Name"]').parent().hide();
}
});
$('#product .checkbox:contains(Number) input[type="checkbox"]').change(function(){
if($(this).is(':checked')){
$('#product input[placeholder="Number"]').parent().fadeIn();
} else {
$('#product input[placeholder="Number"]').parent().hide();
}
});
$('#product input[type="checkbox"]').trigger('change');
});
</script>
Thank youDigitCart wrote: ↑Tue Aug 29, 2017 12:57 pmHello,
This will work for all your products:Demo: https://jsfiddle.net/sabeti05/4dgt2bb1/Code: Select all
<script> $(function(){ $('#product .checkbox:contains(Name) input[type="checkbox"]').change(function(){ if($(this).is(':checked')){ $('#product input[placeholder="Name"]').parent().fadeIn(); } else { $('#product input[placeholder="Name"]').parent().hide(); } }); $('#product .checkbox:contains(Number) input[type="checkbox"]').change(function(){ if($(this).is(':checked')){ $('#product input[placeholder="Number"]').parent().fadeIn(); } else { $('#product input[placeholder="Number"]').parent().hide(); } }); $('#product input[type="checkbox"]').trigger('change'); }); </script>
Who is online
Users browsing this forum: No registered users and 347 guests