cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable a button on click of a CheckBox using javascript in "HTMLB"

Former Member
0 Kudos

Hi .... I am working on JSPDynpage and HBJ .

Can somebody help me for the following requirement-

Enable a Button in HBJ on clicking of a CheckBox using Javascript.

Waiting for replies !!

Regards

Smita

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Smita,

The below link may help you

Regards

Suresh

Former Member
0 Kudos

Smita -

If you want to use javascript in your your jsp to enable the button, then:

write your javascript function to enable the button.

from the onClientClick (not the onClick)of your checkbox, call your javascript function.

onClientClick

Defines the JavaScript fragment that is executed when the user clicks on the button. If both events ('onClick' and 'onClientClick') are specified, the 'onClientClick' event handling method is activated first. By default the 'onClick' event handling method is activated afterwards. In the JavaScript fragment you can cancel the activation of the 'onClick' event handling method with the command:

htmlbevent.cancelSubmit=true;

The 'onClientClick' event is useful to preprocess the form and only send the form to client if the preprocessing was successful (e.g. date validation, valid number format etc.) to save client/server interaction.

A button click usually activates the client/server interaction. If an input field has to be filled out for further processing, the JavaScript fragment can check the necessary input on the client side and display a message if the necessary input is missing, without server interaction.

To use JavaScript the JSP has to use the page tag (set page tag).

Former Member
0 Kudos