Enable server button control from client code?

N

News Groups

Hello dotnet framework group,

This question on the webforms controls.

I have a web form (C# behind form) with 2 buttons (one a regular html input,
type = button, not submit)

and a webforms button (used to submit data on form to database). I run
some client code when the html button is clicked (loads two text fields with
a date). I have the "Submit" button disabled, and I would like to be able
to enable the "Submit" button after the the html button is clicked. the
idea is to prevent user from submitting form/data until the dates have been
calculated. I am unable (so far) to enable the button from the client code.
Is there a way to do this??

I have tried the following statements to no avail:
document.getElementById("btnInsert").setAttribute("Enabled");
document.getElementById("btnInsert").Enabled = true, etc. and
document.all.item("btnInsert").enabled = true;

I either get errors or the client code runs, but does not enable the button.
I know I am missing something basic. Any help will be appreciated.

Thanks,

eric
 
J

Jeffrey Palermo [MCP]

In the HTML DOM, there is no "enabled" property. That is the .Net property.
The client side property is "disabled". You should check the rendered HTML
when you are doing something like this.

Best regards,
Jeffrey Palermo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,272
Latest member
MaricruzDu

Latest Threads

Top