473,808 Members | 2,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How To Edit The Same Text Box?

Hi.

Can somebody tell me how I would go about allowing the user
to click on a link to put content in text box A and then another
link to put different content in text box A and so on. Finally,
when onsubmit is fired, all the content created for each individual
link (using the same text box) is sent to SQL Server.

How do I reuse the same text box in this manner?

Thanks!

May 8 '07 #1
7 3971
You could append the "content" from each click into a variable,
and then for each click the textbox simply displays the text for the
most recent click.

Then you are not sending the textbox value to the server; you send the
value of the variable, which is the whole history of all the clicks, not
just the most recent click that shows in the textbox.

pbd22 wrote:
Hi.

Can somebody tell me how I would go about allowing the user
to click on a link to put content in text box A and then another
link to put different content in text box A and so on. Finally,
when onsubmit is fired, all the content created for each individual
link (using the same text box) is sent to SQL Server.

How do I reuse the same text box in this manner?

Thanks!
May 8 '07 #2
On May 8, 3:40 pm, töff <t...@arcticcoc onut.comwrote:
You could append the "content" from each click into a variable,
and then for each click the textbox simply displays the text for the
most recent click.

Then you are not sending the textbox value to the server; you send the
value of the variable, which is the whole history of all the clicks, not
just the most recent click that shows in the textbox.

pbd22 wrote:
Hi.
Can somebody tell me how I would go about allowing the user
to click on a link to put content in text box A and then another
link to put different content in text box A and so on. Finally,
when onsubmit is fired, all the content created for each individual
link (using the same text box) is sent to SQL Server.
How do I reuse the same text box in this manner?
Thanks!
kind of like:
function addTTextBox(str )
{
var strSeparator = '\n';
document.getEle mentById('textb ox_id').value += strSeparator + str;"
}
then in the link

onclick="addToT extBox(this.inn erHTML)"

but this leaves you to say more about what you mean "text from links"
do you mean the innerHTML, the href, etc... that part was not very
well explained,

May 8 '07 #3
Lee
pbd22 said:
>
Hi.

Can somebody tell me how I would go about allowing the user
to click on a link to put content in text box A and then another
link to put different content in text box A and so on. Finally,
when onsubmit is fired, all the content created for each individual
link (using the same text box) is sent to SQL Server.

How do I reuse the same text box in this manner?
You can't start without being able to clearly define what you want.

You don't want the links to "put different content" into the text
box. You want them to "append new content" to any value which may
already be there, right?

And I don't think you really want the values sent when onsubmit
fires. You want them sent when the form is submitted, right?

Why are you using links instead of buttons?
What specific part of this assignment are you having trouble with?
Can you show us what you've got so far?
--

May 8 '07 #4
On May 8, 7:50 am, shimmyshack <matt.fa...@gma il.comwrote:
On May 8, 3:40 pm, töff <t...@arcticcoc onut.comwrote:
You could append the "content" from each click into a variable,
and then for each click the textbox simply displays the text for the
most recent click.
Then you are not sending the textbox value to the server; you send the
value of the variable, which is the whole history of all the clicks, not
just the most recent click that shows in the textbox.
pbd22 wrote:
Hi.
Can somebody tell me how I would go about allowing the user
to click on a link to put content in text box A and then another
link to put different content in text box A and so on. Finally,
when onsubmit is fired, all the content created for each individual
link (using the same text box) is sent to SQL Server.
How do I reuse the same text box in this manner?
Thanks!

kind of like:

function addTTextBox(str )
{
var strSeparator = '\n';
document.getEle mentById('textb ox_id').value += strSeparator + str;"}

then in the link

onclick="addToT extBox(this.inn erHTML)"

but this leaves you to say more about what you mean "text from links"
do you mean the innerHTML, the href, etc... that part was not very
well explained,
OK, thanks both for your responses.
but this leaves you to say more about what you mean "text from links"
I have a display div on the page showing files for upload. I want the
user to associate descriptions and a title for each file. So, the
display div has, say, five files waiting for upload inside it. Each
file has an anchor tag surrounding it making it a link. when clicked,
that activates the text box that is already visible lower down on the
page. So, when the first file in the list is clicked that would allow
the user to fill out text for this upload. When the next file in the
list is clicked, the text box becomes empty and the user can fill in
the associated text. And so on. When a user wants to go back to a
given entry, all he need to is click on a link in the "files" list and
the entry for that given file appears. It's sort of like an ajax
database query but, without the trip to the server.

Here Is A "VIEW SELECTION SOURCE" of three files in the queue:

<div id="files"><di v style="text-decoration: none;"><a href="#nogo"
style="color: blue; text-decoration: none;">get_file .txt </a></
div><div style="text-decoration: none;"><a href="#nogo" style="color:
blue; text-decoration: none;">monkey.f lv </a></div><div style="text-
decoration: none;"><a href="#nogo" style="color: blue; text-
decoration: none;">upload_c ode.rtf</a></div></div>

May 8 '07 #5
Lee,

Thanks for your response.
You don't want the links to "put different content" into the text
box. You want them to "append new content" to any value which may
already be there, right?
This isn't correct. I want to give the user the feeling that, after
clicking
a link (which, in this case, is acting as a button) to a file the text
box will be
empty and awaiting whatever he wants to write. Should he write
something
for a given file and then go back to it, the text he associated with
this particular file will appear (and, no others).
And I don't think you really want the values sent when onsubmit
fires. You want them sent when the form is submitted, right?
This is correct.
Why are you using links instead of buttons?
This is a stylistic call and I prefer them.
Can you show us what you've got so far?
I am sorry, my site isn't live. I would be happy to post more code if
the code I have already post isn't helping.

Thanks again for your help!

May 8 '07 #6
pbd22 said the following on 5/8/2007 10:28 AM:
Hi.

Can somebody tell me how I would go about allowing the user
to click on a link to put content in text box A and then another
link to put different content in text box A and so on. Finally,
when onsubmit is fired, all the content created for each individual
link (using the same text box) is sent to SQL Server.

How do I reuse the same text box in this manner?
Why make it harder than it has to be though? If the user can associate
data with each file, you have two choices:

1) Create a text input for each file and let them type.
2) Create an array that tracks what each description is. When it is
clicked, you put that description in the textbox and let them edit. Use
the onchange event for the textbox to update the array.

Then use the onsubmit to put all the data from the array in an element
and submit it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 8 '07 #7
On May 8, 10:28 am, Randy Webb <HikksNotAtH... @aol.comwrote:
pbd22 said the following on 5/8/2007 10:28 AM:
Hi.
Can somebody tell me how I would go about allowing the user
to click on a link to put content in text box A and then another
link to put different content in text box A and so on. Finally,
when onsubmit is fired, all the content created for each individual
link (using the same text box) is sent to SQL Server.
How do I reuse the same text box in this manner?

Why make it harder than it has to be though? If the user can associate
data with each file, you have two choices:

1) Create a text input for each file and let them type.
2) Create an array that tracks what each description is. When it is
clicked, you put that description in the textbox and let them edit. Use
the onchange event for the textbox to update the array.

Then use the onsubmit to put all the data from the array in an element
and submit it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptT oolbox.com/bestpractices/
Thanks Randy. Your suggestion makes sense. I'll try that.

May 9 '07 #8

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

Similar topics

25
10428
by: dixie | last post by:
I have some code that adds new records into a table for each ID in a list box when a button on a form is clicked. This works fine. My problem now is that I wish to be able to edit all the records for people whose ID is in the list box. I made minor changes to the code (mainly replacing rs.AddNew with rs.Edit)and it appears to be updating only the first record and then overwriting that record with the next, etc until it runs out of ID's...
46
4269
by: Keith K | last post by:
Having developed with VB since 1992, I am now VERY interested in C#. I've written several applications with C# and I do enjoy the language. What C# Needs: There are a few things that I do believe MSFT should do to improve C#, however. I know that in the "Whidbey" release of VS.NET currently
3
9473
by: Ronald S. Cook | last post by:
Hi all, I have an ASP.NET DataGrid wherein there is an edit link for each row. Upon clicking the link, certan fields in that row display in text boxes so that they may be edited. I would like some textboxes to be wider, some narrower. By default, they are all the same pre-defined width. Does anyone know how I can do this? Thanks very much,
0
3120
by: Alex | last post by:
Interested in more .NET stuff visit www.dedicatedsolutions.co.uk The DataList is not as powerful as the DataGrid. It requires more work from you since it has no default data presentation format. However, the DataGrid begins to get very cumbersome as the number of columns of data you present increases. Anything more than half a dozen columns or so and you probably induce horizontal scrolling - a real no-no for me. If you put such a...
3
1638
by: Leo | last post by:
I have a datagrid with the first column as a Edit,Update,Cancel button column. The other 5 columns are template columns. When I click the Edit button in IE6 the row correctly displays the controls defined in the <EditItemTemplate> however when I right click and do a view source I cannot find any of the input textboxes in the source. I have used the ItemDatabound event to try to attach javascript to the textboxes and in debug mode while...
1
1622
by: rp13 | last post by:
Hi, I am using a asp:datagrid which is editable. Though I have handlers wired to my edit, update & cancel events, some how when i click on the edit button nothing happens. The edit template items does not appear. I have to click on the edit once again for the items to change. Same thing happens when i click on the update & cancel buttons. I found that though the event handler gets executed the first time (in all 3 cases) , it does not...
1
12236
by: cyningeston | last post by:
OS: WinXP Pro, VB/ASP/ADO.NET I'm building a web-based supplier management application. For each supplier we are required by the FDA to track certain documents. I've managed to pull them from Access into a Gridview (Gridview1), in which I have AutoGenerateEditButton set to True. What I want is this: when a user clicks "Edit" on a line and it goes to edit mode, I want to grab the supplier's category (4th column of the grid, named...
9
2734
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the code: <script runat="server"> Dim sqlConn As New SqlConnection(".....") Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) If Not (Page.IsPostBack) Then FillDataGrid()
2
1667
by: sara | last post by:
I use Allen Browne's Audit Trail code in everything I do and I love it. Recently, I've run into a problem I can't figure out. I have a database with about 35 lookup tables. I am creating an "Admin" screen to allow the head social worker to maintain items in the list. (This is a volunteer project for a non-profit that is trying to help elders "age successfully" in their own homes, and I'm trying to help them do some tracking for...
1
2137
by: Xicon | last post by:
I am looking to create a program that is able to edit a text file that is not located within the program. This particular text file is always in the exact same location and is always named the exact same, and I would like to find a way to make it easily editable. How do I edit the text file (a single line needs to be changed) using a Visual Basic 2008 program? Please help me, I will be VERY appreciative! EDIT: I use Visual Basic 2008...
0
9721
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
10373
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
10374
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
10113
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...
0
5547
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3859
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
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.