Set TextField Size Using JQuery

Hi,
I just came to know that there is a way that, we can set the size of a textbox using JQuery but don’t know how, any idea?

Regards
Ruchin Sharma

Hi,
please try cur_frm.set_df_property(“field_name”, “length”, value); in onload or refresh.

Hi @ruchin78! Try also this:

frappe.ui.form.on("Purchase Receipt", "onload", function(frm) {
        frm.get_field('items').grid.editable_fields = [
	{fieldname: 'item_code' ,columns: 1},
	{fieldname: 'qty' ,columns: 1},
        {fieldname: 'rate' ,columns: 1},
	{fieldname: 'amount' ,columns: 1},
        ];
}); 

@SwitsolAG I tried it, but didn’t work.

@creamdory
You have done this on a child table, what if I need to do it on parent fields.

Regards
Ruchin Sharma

I am using below code to set the same, and the interesting part is, it works on console but gives error when I write it in custom script:

cur_frm.fields_dict.invoice_no.$input.height(15);

Error Message: TypeError: Cannot read property ‘height’ of undefined

Any idea why?

Regards
Ruchin Sharma