Button click event help


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



You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@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.

 

 

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.

On 30-Nov-2012, at 5:23 PM, SK <Sh...@sapcle.com> wrote:


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



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@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.

 

 




You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Anand,

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

Sharhan

On Friday, November 30, 2012 5:29:23 PM UTC+5:30, Anand Doshi wrote:

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.

On 30-Nov-2012, at 5:23 PM, SK <Sh…@sapcle.com> wrote:


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





 




You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/SzdcOfiZtloJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Hi Sharhan,

Glad to help.

-Anand.

On 30-Nov-2012, at 5:38 PM, SK <Sh...@sapcle.com> wrote:

Anand,

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

Sharhan

On Friday, November 30, 2012 5:29:23 PM UTC+5:30, Anand Doshi wrote:
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.

On 30-Nov-2012, at 5:23 PM, SK <Sh...@sapcle.com> wrote:


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





 





You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/SzdcOfiZtloJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

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
am...@creatywa.com

On Friday, 30 November 2012 17:39:11 UTC+5:30, Anand Doshi wrote:

Hi Sharhan,

Glad to help.

-Anand.

On 30-Nov-2012, at 5:38 PM, SK <Sh…@sapcle.com> wrote:

Anand,

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

Sharhan

On Friday, November 30, 2012 5:29:23 PM UTC+5:30, Anand Doshi wrote:
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.

On 30-Nov-2012, at 5:23 PM, SK <Sh…@sapcle.com> wrote:


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





 





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-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/SzdcOfiZtloJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

To post to this group, send email to er...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/2bb6f3b4-8f39-4a00-8cda-5852a5596308%40googlegroups.com?hl=en.

For more options, visit https://groups.google.com/groups/opt_out.