ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Hide which worked in v10 not working in V11

custom_script

#1

I used this in erpnext v10 and it worked fine in custom script

 $("textarea[data-fieldname='id_s']").hide();

This is a custom field of type small-text

But this isn’t working in v11.

Can anyone help me out whats the issue


#3

This is the field named dat

I am trying to hide it using custom script and its condition to hide it using custom script coz its a field in custom dialog. If I use hidden:1 where I am creating the field, although its hiding by that way but it is also not letting me fetch the value. So need to do it by jquery.

$(document).ready(function(){
$('textarea[data-fieldname="dat"]').hide();
});

Can anyone tell me whats wrong I’m doing.

Thanks


#4

This is the exact code which worked on v10 but not in v11.

Any suggestions

frappe.ui.form.on("View","onload",function(){
cur_frm.add_custom_button(__("Hide"), function(click) {
var d = new frappe.ui.Dialog({
    'fields': [
        {'fieldname': 'ht', 'fieldtype': 'HTML'},
        {'fieldname': 'today', 'fieldtype': 'Date', 'default': frappe.datetime.nowdate()},
	{'fieldname': 'htt', 'fieldtype': 'Small Text'}
    ],
    primary_action: function(){
        d.hide();
        show_alert(d.get_values());
    }
});
d.fields_dict.ht.$wrapper.html('Hello World');
    $("textarea[data-fieldname='htt']").hide();

d.show();
})
});

#5

Figured it out. Had to use

dialog_variable_name.fields_dict.field_name.$wrapper.hide();