Frappe javascript on click not working

How to generate pdf on button click

https://github.com/frappe/frappe/blob/develop/frappe/public/js/frappe/form/print.js#L65

1 Like

thanks for the fast replay

but i wrote below code on my js file

this.wrapper.find(“#download”).click(function() {

console.log(“clicked”);

});

then i clicked has id = download

nothing shows on console of chrome

may be wrapper not contain ‘#download’ element. plese check output for
this.wrapper.find(“#download”)

1 Like

i tried but again nothing in console

@shahid_khan021,

Can you share the full code. Also if you have added the custom button on document then you can use the following syntax for button click event.

frappe.ui.form.on(“Your DocType”, “button_fieldname”, function(){
// your code
})

Thanks,
Makarand

1 Like

@makarand_b i droped the idea but thanks for your replay

may be it will help me in some other situation