473,509 Members | 2,950 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically Adding Text Fields

MRW
I'm working on a form where the default is to have one text box for a
phone number. However, if a person wants, they can click on a button
and it will add another field below it, so they can have more than one.
I was able to do this quite easily with ASP & Javascript, but being
that I need the textboxes bound to data, it's a tad more complicated.
Any ideas on how to handle the function that will add text boxes?

Thanks for any help!

Aug 14 '06 #1
2 1124
If you are only allowing one extra textbox, simply hide it and show it when
they want to add another one. This is not elegant, by any means, but easier
than beating your head against the wall. If you want any number of extra
phone numbers, then you should set up a grid and allow people to add numbers
to it. You can submit the complete "phone number" dataset to the database on
submit.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think Outside the Box!
*************************************************
"MRW" <mw*****@yahoo.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
I'm working on a form where the default is to have one text box for a
phone number. However, if a person wants, they can click on a button
and it will add another field below it, so they can have more than one.
I was able to do this quite easily with ASP & Javascript, but being
that I need the textboxes bound to data, it's a tad more complicated.
Any ideas on how to handle the function that will add text boxes?

Thanks for any help!

Aug 15 '06 #2
MRW
Mmmm....
Very nice idea! I'll try it out, thanks!

Cowboy (Gregory A. Beamer) wrote:
If you are only allowing one extra textbox, simply hide it and show it when
they want to add another one. This is not elegant, by any means, but easier
than beating your head against the wall. If you want any number of extra
phone numbers, then you should set up a grid and allow people to add numbers
to it. You can submit the complete "phone number" dataset to the database on
submit.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think Outside the Box!
*************************************************
"MRW" <mw*****@yahoo.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
I'm working on a form where the default is to have one text box for a
phone number. However, if a person wants, they can click on a button
and it will add another field below it, so they can have more than one.
I was able to do this quite easily with ASP & Javascript, but being
that I need the textboxes bound to data, it's a tad more complicated.
Any ideas on how to handle the function that will add text boxes?

Thanks for any help!
Aug 15 '06 #3

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

Similar topics

5
2052
by: Lukelrc | last post by:
Hi, I have a dynamically created listbox. I'm trying to get one of the options selected according to a passed value. This is what i have: <select name="txtTheme" id="txtTheme"> ...
1
2382
by: Peter Kirk | last post by:
Hi there I have a form which submits a list of data to a web-application (which then saves to a database). The list consists of four input fields per row. Eg....
2
18546
by: RobG | last post by:
I am trying to dynamically add an onclick to an element, however I just can't get the syntax right. consider the following function: function doClick (evt,x) { // do things with evt and x } ...
5
4882
by: john_williams_800 | last post by:
Hi; I am just starting to use the DOM to do some more advanced javascripting so please be patient with my question if it is an ignorant question. I would like to use the DOM to dynamically...
0
2456
by: sameer mowade via .NET 247 | last post by:
Hello All, I have problem while dynamically removing row from the Datagrid which i have added dynamically as shown in the following code snippet. The problem is that while removing dynamically...
4
3600
by: MattB | last post by:
Hello. I'm creating a page to edit a person's record (name address, etc) using a DataGrid. I want the fields that can be edited to be created at runtime based on a list of columns in web.config....
4
1391
by: Alex Denton | last post by:
Okay, here's my problem: I need to populate different fields in an HTML table with TextBoxes. For example, if I had 3 columns "Name", "Address", and "City"; I need to have a TextBox in all of...
4
4454
by: Lewis Holmes | last post by:
Hi I have the following situation in one of my asp.net pages. The user can add multiple table rows to a form by selecting a button. These rows can contain asp.net controls. When this button is...
7
6179
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I'm adding subheadings to a gridview. Each sub head has a few link buttons. I'm adding the controls in the rowdatabound event code follows: sorry about the length here. I have to be missing...
1
4871
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
0
7412
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...
1
7069
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...
0
5652
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,...
1
5060
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...
0
3216
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...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
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 ...
1
775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
441
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...

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.