Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



how to hide a textbox in asp.net

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 10-06-2009
Member
 
Join Date: Dec 2008
Posts: 161
how to hide a textbox in asp.net
  

There are two text boxes on my .net page they have function which activate but at different time. I want script to hide one text box while another text box is selected that means only one text box allowed to perform when it is selected. Is that possible?

Reply With Quote
  #2  
Old 10-06-2009
Member
 
Join Date: May 2008
Posts: 2,007
Re: how to hide a textbox in asp.net

Code:
<%@ Page Language="VB" debug="true"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb"%>

<script language="VB" runat=server>
Dim text As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.
4.0;Data Source=C:\jamal_vb_asign\StoresDbs.mdb")
Dim myProduct_Number as string

Sub Insert_Click(ByVal frs As Object, ByVal G As EventArgs)
Dim BDA As OleDbDataAdapter
Dim BDS As New DataSet
Dim BSql As String
text.Open()


BDA = New OleDbDataAdapter(sSql, oConn)
 BDA.Fill(oDS, "product")
myProduct_Number.Text =
BDS.Tables("product").Rows(0).Item("Product_Number ")

End Sub

Private Function update(ByVal text As OleDbConnection, ByVal
StextQL As String) As Integer
Dim textsql As Integer
' Connect to Database
text.Open()
'Make the OleDbCommand object
Dim strtext As New OleDbCommand(strInsertSQL, oConn)
intQueryState = cmdInsert.ExecuteNonQuery()
text.Close()
Return intQueryState
End Function
Reply With Quote
  #3  
Old 10-06-2009
Member
 
Join Date: Jan 2009
Posts: 199
Re: how to hide a textbox in asp.net

Code:
hidetext1.Attributes.Add("onclick" , "HideTextbox(' " + hidetext2.ClientID + " ' , '  " + hidetext1.ClientID +" ');");

 hidetext2.Attributes.Add("onclick" , "HideTextbox(' " + hidetext1.ClientID + " ' , '  " +hidetext2.ClientID +" ');"); 

In your .aspx page -

<script type='text/javascript'>

 function HideTextbox(Horitxtbox , Vertxtbox)

{

       document.GetElementByID((Horitxtbox).style.visibility = 'hidden';

       document.GetElementByID(Vertxtbox).style.visibility = 'visible'; 

} 

</script>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "how to hide a textbox in asp.net"
Thread Thread Starter Forum Replies Last Post
Excel/VBA: Copying text from UserForm Textbox to a Worksheet Textbox Neil Ives Software Development 2 20-08-2010 01:23 AM
Textbox validation in ASP.NET Kasper Software Development 4 19-01-2010 07:28 PM
Moving from one TextBox to another with TAB GeforceUser Software Development 3 05-11-2009 05:31 PM
Auto-Hide toolbar won't hide? Geoff from LA Vista Help 8 18-10-2009 06:52 AM
How to recover a value in a textbox S_Asnodkar Software Development 4 29-04-2009 03:37 PM


All times are GMT +5.5. The time now is 02:42 AM.