Back to Top
jQuery('.manufacturer input[name=manufacturer]').on('change',function(){
var manufacturer = jQuery(".manufacturer input[name=manufacturer]");
var manufacturerChecked = manufacturer.filter(":checked").val();
if(manufacturerChecked =="ไม่ใช่ที่เดียวกับสถานประกอบการ"){
jQuery('.manufacturer_address').show();
jQuery('.manufacturer_address input').prop('required',true);
}else{
jQuery('.manufacturer_address').hide();
jQuery('.manufacturer_address input').val('');
jQuery('.manufacturer_address input').prop('required',false);
}
});
jQuery('input[name="product_highlights1"]').on('change',function(){
var product_highlight1 = jQuery(jQuery('input[name="product_highlights1"]')[0]);
var product_highlight1_checked = product_highlight1.val();
if(product_highlight1_checked == 1){
jQuery('.product-highlights1_txt').show();
jQuery('.product-highlights1_txt input').prop('required',true);
}else{
jQuery('.product-highlights1_txt').hide();
jQuery('.product-highlights1_txt input').val('');
jQuery('.product-highlights1_txt input').prop('required',false);
}
});
jQuery('input[name="product_highlights2"]').on('change',function(){
var product_highlight2 = jQuery(jQuery('input[name="product_highlights2"]')[0]);
var product_highlight2_checked = product_highlight2.val();
if(product_highlight2_checked == 1){
jQuery('.product-highlights2_txt').show();
jQuery('.product-highlights2_txt input').prop('required',true);
}else{
jQuery('.product-highlights2_txt').hide();
jQuery('.product-highlights2_txt input').val('');
jQuery('.product-highlights2_txt input').prop('required',false);
}
});
jQuery('input[name="product_highlights3"]').on('change',function(){
var product_highlight3 = jQuery(jQuery('input[name="product_highlights3"]')[0]);
var product_highlight3_checked = product_highlight3.val();
if(product_highlight3_checked == 1){
jQuery('.product-highlights3_txt').show();
jQuery('.product-highlights3_txt input').prop('required',true);
}else{
jQuery('.product-highlights3_txt').hide();
jQuery('.product-highlights3_txt input').val('');
jQuery('.product-highlights3_txt input').prop('required',false);
}
});
jQuery('.distribution_channel_online input[name="distribution_channel_online"]').on('change',function(){
var distribution_channel_online = jQuery(jQuery('input[name="distribution_channel_online"]')[0]);
var distribution_channel_online_checked = distribution_channel_online.val();
if(distribution_channel_online_checked == 1){
jQuery('.distribution_channel_online_facebook').show();
jQuery('.distribution_channel_online_instagram').show();
jQuery('.distribution_channel_online_twitter').show();
jQuery('.distribution_channel_online_line').show();
}else{
jQuery('.distribution_channel_online_facebook').hide();
jQuery('.distribution_channel_online_instagram').hide();
jQuery('.distribution_channel_online_twitter').hide();
jQuery('.distribution_channel_online_line').hide();
jQuery('.distribution_channel_online_facebook input').val('');
jQuery('.distribution_channel_online_instagram input').val('');
jQuery('.distribution_channel_online_twitter input').val('');
jQuery('.distribution_channel_online_line input').val('');
}
});
jQuery('.distribution_channel_offline input[name="distribution_channel_offline"]').on('change',function(){
var distribution_channel_offline = jQuery(jQuery('input[name="distribution_channel_offline"]')[0]);
var distribution_channel_offline_checked = distribution_channel_offline.val();
if(distribution_channel_offline_checked == 1){
jQuery('.distribution_channel_offline_choice').show();
}else{
jQuery('.distribution_channel_offline_choice').hide();
jQuery('.distribution_channel_offline_choice input[name="distribution_channel_offline_choice"]').prop('checked', false);
}
});