Enabling Web Controls from Client Code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that works on two modes. One of them is for the user to view
the data. The other is for the user to enter/update the data.
I want the user to be able to move from viewing the data in disabled
controls to making the data editable by enabling the text boxes controls. how
do I enable the text boxes from client code and still keep the data in them
all without creating postbacks of course.

HS
 
HS,

You would use javascript hooked up to a link or button the user would click
to edit and set the control's enabled property like this:

<script language="javascript">

function enableField()
{
document.form1.TextBox1.disabled=false;
}

</script>

<a href="javascript:enableField()">Click here to enable the element<a/>


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

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

Back
Top