473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how make a textbox enabled false without postbac k

I have a textbox and a submit button on a page,
I want the user to type in some characters before i enable or make the
submit button visible
<asp:TextBox id="txt" autopostback="true" runat="server" Width="70%"
Rows="4" TextMode="MultiLine"></asp:TextBox>
I used the ontextChnaged event

private void onchange(object sender, System.EventArgs e)
{
if (txtEquivalentRequirement.Text.Length > 0)
{
btnUpdate.Enabled = true;
}
else
{
btnUpdate.Enabled = false;
}

}

But this has to do a postback.
Is there a way i can do this without postback
Any ideas
Mar 23 '06 #1
7 1674
Hi Patrick,

You need to do it client side using Javascript.

--
Ward Bekker
"Asp.Net Discussions for the Professional Developer"
http://www.dotnettaxi.com

"Free .Net 2.0 C# to/from VB.Net Code Converter"
http://www.dotnettaxi.com/Tools/Converter.aspx
Mar 23 '06 #2
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Is there a way i can do this without postback


This is fairly standard DHTML with client-side JavaScript...
Mar 23 '06 #3
Yes i know i should be able to use js for that
But any samples ? if not then i would have to bring up something
Thx

"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:u5**************@TK2MSFTNGP09.phx.gbl...
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Is there a way i can do this without postback


This is fairly standard DHTML with client-side JavaScript...

Mar 23 '06 #4
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:e9**************@TK2MSFTNGP09.phx.gbl...
Yes i know i should be able to use js for that
But any samples ? if not then i would have to bring up something


Tsk! Tsk! Patrick... :-)

<form id="frmDefault" method="post" runat="server">
<input type=text id=txtInput
onkeyup="document.getElementById('cmdButton').disa bled =
(document.getElementById('txtInput').value.length == 0);">
<input type=button id=cmdButton value="Test">
</form>
Mar 23 '06 #5
note: if clientscript disables the control, the browser will not post it, so
the server will see the value.

-- bruce (sqlwork.com)

"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:OR**************@TK2MSFTNGP10.phx.gbl...
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:e9**************@TK2MSFTNGP09.phx.gbl...
Yes i know i should be able to use js for that
But any samples ? if not then i would have to bring up something


Tsk! Tsk! Patrick... :-)

<form id="frmDefault" method="post" runat="server">
<input type=text id=txtInput
onkeyup="document.getElementById('cmdButton').disa bled =
(document.getElementById('txtInput').value.length == 0);">
<input type=button id=cmdButton value="Test">
</form>

Mar 23 '06 #6
"Bruce Barker" <br******************@safeco.com> wrote in message
news:e5**************@TK2MSFTNGP09.phx.gbl...
note: if clientscript disables the control, the browser will not post it,
so the server will see the value.


Er...
Mar 23 '06 #7
Mark,
Tsk.. Er..
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Apr 10 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Gill Smith | last post by:
After setting the web control text box enable property to FALSE makes the control to loose the data between round trip. I am making sure that the property - EnableViewState = TRUE. Same code...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
2
by: Randy | last post by:
I'm trying to loop through all of the textboxes on my form and change some of their properties. I'm stuck on changing the border style to none. Here is my code: Dim c As Control For Each c In...
6
by: Brandon McCombs | last post by:
Hello, I have a Form that contains some configuration information. One of the settings is for SSL. There is a checkbox that I want to check to make 2 textboxes un-editable so that a user can...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.