Button click event help

111 views
Skip to first unread message

SK

unread,
Nov 30, 2012, 6:53:13 AM11/30/12
to erpnext-dev...@googlegroups.com

Hi,

I have written a custom script, i just want it be executed when i press a button, ie click event. I have created a custom field with type button called checkin.Now i want to execute a client side code, when that button is clicked.

Can you please tell me the event, so that i can write  the prepared code below it. I am just having difficulties with name and id of button.

when the button is clicked i want to write to read only text box , the time they have checked in.

I am able to write to text box the current time, but i want it to be when i click textbox check in

Thanks

Anand Doshi

unread,
Nov 30, 2012, 6:59:23 AM11/30/12
to erpnext-dev...@googlegroups.com
Hi,

If button fieldname is "test_button",

you can use

cur_frm.cscript.test_button = function(doc) {
alert("test");

doc.read_only_textbox = "something";
refresh_field("read_only_textbox");
}

Thanks,
Anand.

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To unsubscribe from this group, send email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/U5Ae1VbcxuMJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

SK

unread,
Nov 30, 2012, 7:08:30 AM11/30/12
to erpnext-dev...@googlegroups.com
Anand,

Thanks a lot.Really thanks for the fast reponse. The issues is solved.
Have nice Day

Sharhan

Anand Doshi

unread,
Nov 30, 2012, 7:09:11 AM11/30/12
to erpnext-dev...@googlegroups.com
Hi Sharhan,

Glad to help.

-Anand.

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To unsubscribe from this group, send email to erpnext-developer...@googlegroups.com.

Amol J

unread,
Jun 6, 2013, 1:10:48 AM6/6/13
to erpnext-dev...@googlegroups.com
Hi SK,

We are planning to implement similar functionality for chekin and checkout in attendance form. We dont have the necessary technical expertise to code the custom script. I would be really glad if you could share the custom script with us.

This will solve our major problem.

Thanks you for your support.

Regards,
Amol
amol....@creatywa.com
To unsubscribe from this group, send email to erpnext-developer-forum+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages