473,657 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Not able to retrieve the values of text box

1 New Member
I have a form with Repeater . The repeater has Radio buttons, textareas, Check box. How do I get the values of the text area when the form is submitted to be saved to the database. I was able to get the values of other controls and not the values of textarea. Any help would be appreciated.

Expand|Select|Wrap|Line Numbers
  1.  
  2. ltrDisplayText = CType(e.Item.FindControl("ltrDisplayText"), System.Web.UI.WebControls.Literal)
  3.  
  4.   If Trim(Right(strDisplay, 4)) = Trim("TEXT") Then
  5.        ltrDisplayText.Text = "<TEXTAREA id='" & ltrDisplayText.ClientID & "' rows='5' cols='50'" & " name=" & drvData.Item("QuestionID").ToString.Trim & "'></TEXTAREA>"
  6.   Else
  7.        ltrDisplayText.Text = ""
  8.   End If
]
Jul 13 '07 #1
1 1367
nateraaaa
663 Recognized Expert Contributor
I have a form with Repeater . The repeater has Radio buttons, textareas, Check box. How do I get the values of the text area when the form is submitted to be saved to the database. I was able to get the values of other controls and not the values of textarea. Any help would be appreciated.

Expand|Select|Wrap|Line Numbers
  1.  
  2. ltrDisplayText = CType(e.Item.FindControl("ltrDisplayText"), System.Web.UI.WebControls.Literal)
  3.  
  4.   If Trim(Right(strDisplay, 4)) = Trim("TEXT") Then
  5.        ltrDisplayText.Text = "<TEXTAREA id='" & ltrDisplayText.ClientID & "' rows='5' cols='50'" & " name=" & drvData.Item("QuestionID").ToString.Trim & "'></TEXTAREA>"
  6.   Else
  7.        ltrDisplayText.Text = ""
  8.   End If
]
You will need to create a new textbox and assign its value to the textbox in the repeater using the FindControl method

Expand|Select|Wrap|Line Numbers
  1. Dim txt As TextBox = CType(e.Item.FindControl("ltrDisplayText)"),TextBox)
  2. Dim EnteredText As String = txt.Text
Use EnteredText as the parameter that you pass to your stored procedure or query.

Nathan
Jul 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1309
by: Jeff Johnson [MVP: VB] | last post by:
Is there any way to retrieve the name of a capture group from the classes provided in the RegularExpressions namespace? GroupCollection implements ICollection and IEnumerable, not IDictionary, so there doesn't seem to be any means to retrieve key values. While I realize this isn't generally needed in a production scenario (you normally KNOW what your groups are called), it is quite necessary if you're building a general regular...
0
1445
by: Xiru | last post by:
I would like to retrieve the value from a DataList on postback. I can read the ItemIndex and values from a child TextBox but not cannot seem to find a way to read a databound item on the datalist. Here is some code to help clarify. I want to display the items from a shopping list that had a unit number filled in a textbox next to the product: ' Create a holding place for list items with units filled in Dim itemsUnits As New DataSet Dim...
2
2845
by: Uncle_Albert | last post by:
Hi peeps, Here's a screenshot of a particular form in my program. http://www.jdr.dsl.pipex.com/dg1.JPG Basically, when I click on 'Refresh Totals', I want it to retrieve all values from the ItemPrice column, add 'em together and output the result to the sub total text box (I've manually entered the value already in there).
1
1819
by: j.t.w | last post by:
Hi. I'm new to ASP.Net and I'm running into a simple problem (I think). I'm trying to get 2 values from 2 separate queries into 2 different variables. I would then like to take the difference of the two varaibles and place it into a label on an .aspx page. Basically, MyGrossSales = GrossSales from query
11
1921
by: Patricio | last post by:
Hello all I open a PopUp that receives two variables (values). This PopUp must return a value as well. How can I retrieve this value? Thanks a lot.
3
1495
by: bazubwabo | last post by:
hi everybody , could u please help me to find out the error on my asp codes,i can't retrieve the inserted values. Here is below the code: <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <% connect_string = "Driver={SQL Server};Server=NLROSDBCL9-10;Database=Scanners;Uid=scanners;Pwd=bertrand;"
9
4781
by: Mel | last post by:
I have 10 columns total. 3 of them are invisible. The rest are read- only BoundFields, 3 of which are editable fields using TemplateFields. Upon editing, I want to validate what the user enters against one of those invisible columns. How do I accomplish this? The code below that I attempted just returns an empty string when I try to retrieve the invisible column data: gvParts.Rows(e.RowIndex).Cells(8).Text
4
2303
chumlyumly
by: chumlyumly | last post by:
Hi - I'm working with PHP5 MySQL Mac OSX I've developed two pages where a user can input his/her info, which goes to a MySQL database. The first page is supposed to pass the newly created 'member_id' (which is an auto-increment field in the 'members' table) to the second page, where I have records going into another table that uses 'member_id' as a foreign key. I've downloaded and used the Dreamweaver Server Behaviour...
2
3694
by: chirag1989 | last post by:
i have created an arry of text box now i want to retrieve the values of each text box so as to insert them in data base can anyone help how can i retrieve the values of array of textbox and store it in other array Code Of creating text box array <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <form action="ext1.asp" method="post"> <%for i=0 to 4 response.write "<input type=text name=txt id="&i&" ><br>"
0
8403
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8316
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8737
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8509
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8610
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6174
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.