RE: How to get value on postback Dynamically Created controls by javas
- From: Anand Rajagopalan <Anand Rajagopalan@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 4 Mar 2006 08:46:20 -0800
Amit,
You can use Request.Form["App1"] (C#) or Request.Form("App1") (VB.NET) to
access values of controls created on the client side by javascript.
You may also want to create a hidden text field and update value of that
field with number of textboxes created on the client side.
Then retrieve this (hidden text box) value first on the server side for
count of fields created. Then use Request.Form("") to retrieve values of
textboxes created.
Regards,
Anand.
"Amit Maheshwari" wrote:
I have my aspx page on which i am creating <input type=text> on client side.
using javascript. Now when i submit my page i need to access these controls
to get the value entered by the user.
the code is like
<script language="javascript">
<!--
//to count no of file upload controls
var intRowCount = 2;
function AddApp()
{
var strInner='';
var objTBody = document.getElementById('AppBody');
//creating columns
var objCell1 = document.createElement("TD");
var objCell2 = document.createElement("TD");
var objCell3 = document.createElement("TD");
//creating row
var objCurRow = document.createElement("TR");
objCurRow.appendChild(objCell1);
strInner = "<input type='text' id='App" + intRowCount +"' >";
objCell2.innerHTML = strInner;
//appending columns in the row
objCurRow.appendChild(objCell2);
strInner = "<input type='text' id='Desc" + intRowCount +"' >";
objCell3.innerHTML = strInner;
//appending columns in the row
objCurRow.appendChild(objCell3);
objCurRow.setAttribute("id","tr"+intRowCount);
//appending row in the TBody
objTBody.appendChild(objCurRow)
intRowCount = parseInt(intRowCount, 10) + 1;
}
-->
</script>
<input type="button" id="AddAppl" value="Add Application"
onclick="AddApp();">
- Follow-Ups:
- Re: How to get value on postback Dynamically Created controls by javas
- From: Amit Maheshwari
- Re: How to get value on postback Dynamically Created controls by javas
- References:
- How to get value on postback Dynamically Created controls by javascript
- From: Amit Maheshwari
- How to get value on postback Dynamically Created controls by javascript
- Prev by Date: Audio Video Online Store
- Next by Date: Re: Unable to Open Web Project
- Previous by thread: How to get value on postback Dynamically Created controls by javascript
- Next by thread: Re: How to get value on postback Dynamically Created controls by javas
- Index(es):
Relevant Pages
|