| | |
How can i add textboxes dynamically in an asp page
Please support our ASP advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Apr 2005
Posts: 4
Reputation:
Solved Threads: 0
Hi there,
Can anyone help me out..
I have a page where in I have a table
(Iits related to the tradein offers to enter one by one)
when the new page is requested, all the rows in the table will be blank
and when i click on the new offrer button, I should be able to add text boxes in the table and do some modifications.
(I know its easy in asp.net, but i am stuck with asp, and my deliverable is coiming nearer)
Is there any way where we can create dynamic text boxes??
Also, when a hyperlink is clicked to get into this page, all the past details stored in the database should be shown in the respective text boxes and ready again for any modifications!
PLS PLS PLs do help me out ..
I know there are a lot of gurus working out there in these issues,
can any one help me???
Thanks in advance
Regards
Can anyone help me out..
I have a page where in I have a table
(Iits related to the tradein offers to enter one by one)
when the new page is requested, all the rows in the table will be blank
and when i click on the new offrer button, I should be able to add text boxes in the table and do some modifications.
(I know its easy in asp.net, but i am stuck with asp, and my deliverable is coiming nearer)
Is there any way where we can create dynamic text boxes??
Also, when a hyperlink is clicked to get into this page, all the past details stored in the database should be shown in the respective text boxes and ready again for any modifications!
PLS PLS PLs do help me out ..
I know there are a lot of gurus working out there in these issues,
can any one help me???
Thanks in advance
Regards
•
•
Join Date: Apr 2005
Posts: 9
Reputation:
Solved Threads: 0
I would personally use Javascript to dynamically add new inputs, but if you must use ASP you can either pass parameters via the query string or hidden fields that tell your script to write out new text fields. Ex: the url of the page where the text field is to be written to the page could be ./mypage.asp. You could then set the onclick of a button to "window.location='./mypage.asp?NEWFIELD=Y'". Your script would then to check for a value for NEWFIELD, by using Request.QueryString("NEWFIELD"), and when it ="Y" you would create a new field. Obviusly there are many different ways to go about this, but this is one of them.
•
•
Join Date: May 2006
Posts: 6
Reputation:
Solved Threads: 1
<Script>
//Expand form with a new File fields if needed.
var nfiles1 = 1;
var nfiles2 = 2;
function Expand()
{
var a,b;
b=document.f.totGoods.value;
a=parseInt(b) + 1 ;
document.f.totGoods.value="";
document.f.totGoods.value=a;
var adh1 = '<b><font face=arial color=red size=2>'+ nfiles2 +'. ';
var adh = '';nfiles1++nfiles2++ files.insertAdjacentHTML('BeforeEnd',adh1); files.insertAdjacentHTML('BeforeEnd',adh);
return false;
}
</Script>
<table border=3 cellpadding=15 cellspacing=10 width=80% bgcolor=#F3DCF8>
<tr>
<td>
<table border=0 cellpadding=5 cellspacing=5>
<tr>
<td>
<b><font face=arial color=red size=2>1. <input class="text" name="txtActivity" style="font-size: xx-small; height: 20; width: 420; border-width: 1px">
<Input Type=Image src=Images\click.gif OnClick=return(Expand()) Style="border=0;background=#FFDEBF;cursor:hand">
<Div ID=files>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
//Expand form with a new File fields if needed.
var nfiles1 = 1;
var nfiles2 = 2;
function Expand()
{
var a,b;
b=document.f.totGoods.value;
a=parseInt(b) + 1 ;
document.f.totGoods.value="";
document.f.totGoods.value=a;
var adh1 = '<b><font face=arial color=red size=2>'+ nfiles2 +'. ';
var adh = '';nfiles1++nfiles2++ files.insertAdjacentHTML('BeforeEnd',adh1); files.insertAdjacentHTML('BeforeEnd',adh);
return false;
}
</Script>
<table border=3 cellpadding=15 cellspacing=10 width=80% bgcolor=#F3DCF8>
<tr>
<td>
<table border=0 cellpadding=5 cellspacing=5>
<tr>
<td>
<b><font face=arial color=red size=2>1. <input class="text" name="txtActivity" style="font-size: xx-small; height: 20; width: 420; border-width: 1px">
<Input Type=Image src=Images\click.gif OnClick=return(Expand()) Style="border=0;background=#FFDEBF;cursor:hand">
<Div ID=files>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
•
•
Join Date: Mar 2007
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
<Script>
//Expand form with a new File fields if needed.
var nfiles1 = 1;
var nfiles2 = 2;
function Expand()
{
var a,b;
b=document.f.totGoods.value;
a=parseInt(b) + 1 ;
document.f.totGoods.value="";
document.f.totGoods.value=a;
var adh1 = '<b><font face=arial color=red size=2>'+ nfiles2 +'. ';
var adh = '';nfiles1++nfiles2++ files.insertAdjacentHTML('BeforeEnd',adh1); files.insertAdjacentHTML('BeforeEnd',adh);
return false;
}
</Script>
<table border=3 cellpadding=15 cellspacing=10 width=80% bgcolor=#F3DCF8>
<tr>
<td>
<table border=0 cellpadding=5 cellspacing=5>
<tr>
<td>
<b><font face=arial color=red size=2>1. <input class="text" name="txtActivity" style="font-size: xx-small; height: 20; width: 420; border-width: 1px">
<Input Type=Image src=Images\click.gif OnClick=return(Expand()) Style="border=0;background=#FFDEBF;cursor:hand">
<Div ID=files>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
Please check your code before posting on the net or atlease explain what you have added.
•
•
Join Date: Jan 2008
Posts: 1
Reputation:
Solved Threads: 0
•
•
•
•
I would personally use Javascript to dynamically add new inputs, but if you must use ASP you can either pass parameters via the query string or hidden fields that tell your script to write out new text fields. Ex: the url of the page where the text field is to be written to the page could be ./mypage.asp. You could then set the onclick of a button to "window.location='./mypage.asp?NEWFIELD=Y'". Your script would then to check for a value for NEWFIELD, by using Request.QueryString("NEWFIELD"), and when it ="Y" you would create a new field. Obviusly there are many different ways to go about this, but this is one of them.
I just wanna know that if we click by the method you described, wont be all other written data vanished???
Awaiting of your quick reply.
![]() |
Similar Threads
- Retriving data from excel sheet into an asp page (ASP)
- ASP.NET / C# Dynamic Control (ASP.NET)
- Retrieving values from pop up and displaying into asp page (ASP)
- How to Create TIME STAMP in ASP page (ASP)
- New ASP page (ASP)
Other Threads in the ASP Forum
- Previous Thread: asp page is invisible
- Next Thread: retain selected value in a dropdown list
| Thread Tools | Search this Thread |
archive asp aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection





