Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 30, 2012 05:18 AM by brijeshvaidya
Member
137 Points
130 Posts
Jun 30, 2012 04:38 AM|LINK
Hello Freinds I Have a Div Container
On Div i am creating Daynamic Textbox Control on Add Click
<Div id="Container">
<input type="Submit" id="AddTextBox" value="Add">
-------Here are my daynamic textbox
<input type="text" value='' class="daynamic">
</Div>
<input type="create" id="create" onclick="GetValue();" value="create">
------------------
I want To Vlaue of all textbox control with concatenate
For Example
Function GetValue()
{
var COntain=TextBoxValue+"$"+Textbox2Value+"$"; // so on
}
please Help
Thanks Kapil
Participant
848 Points
231 Posts
Jun 30, 2012 05:09 AM|LINK
http://forums.asp.net/t/1525698.aspx
this may help you.
Jun 30, 2012 05:18 AM|LINK
<div> <asp:Panel ID="Panel1" runat="server"> </asp:Panel> </div> <div> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" /> </div> protected void Page_Load(object sender, EventArgs e) { } protected void Page_Init(object sender, EventArgs e) { Table tb = new Table(); tb.ID = "tb1"; TableRow tr = new TableRow(); for (int i = 0; i < 3; i++) { TextBox tbox = new TextBox(); tbox.ID = i.ToString(); TableCell tc = new TableCell(); tc.Controls.Add(tbox); tr.Cells.Add(tc); tb.Rows.Add(tr); } Panel1.Controls.Add(tb); } protected void Button1_Click(object sender, EventArgs e) { Table t = (Table)Page.FindControl("Panel1").FindControl("tb1"); TextBox tbox; foreach (TableRow tr in t.Rows) { foreach (TableCell tc in tr.Cells) { foreach (Control c in tc.Controls) { if (c.GetType() == typeof(TextBox)) { tbox = (TextBox)c; Response.Write("TextBox ID = " + tbox.ID + "<br/>"); Response.Write("TextBox Text = " + tbox.Text + "<br/>"); } } } } }
kapshasija
Member
137 Points
130 Posts
How to get Value of All textbox of Div?
Jun 30, 2012 04:38 AM|LINK
Hello Freinds I Have a Div Container
On Div i am creating Daynamic Textbox Control on Add Click
<Div id="Container">
<input type="Submit" id="AddTextBox" value="Add">
-------Here are my daynamic textbox
<input type="text" value='' class="daynamic">
<input type="text" value='' class="daynamic">
<input type="text" value='' class="daynamic">
</Div>
<input type="create" id="create" onclick="GetValue();" value="create">
------------------
I want To Vlaue of all textbox control with concatenate
For Example
Function GetValue()
{
var COntain=TextBoxValue+"$"+Textbox2Value+"$"; // so on
}
please Help
Thanks Kapil
brijeshvaidy...
Participant
848 Points
231 Posts
Re: How to get Value of All textbox of Div?
Jun 30, 2012 05:09 AM|LINK
http://forums.asp.net/t/1525698.aspx
this may help you.
Brijesh Vaidya
India
brijeshvaidy...
Participant
848 Points
231 Posts
Re: How to get Value of All textbox of Div?
Jun 30, 2012 05:18 AM|LINK
<div> <asp:Panel ID="Panel1" runat="server"> </asp:Panel> </div> <div> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" /> </div> protected void Page_Load(object sender, EventArgs e) { } protected void Page_Init(object sender, EventArgs e) { Table tb = new Table(); tb.ID = "tb1"; TableRow tr = new TableRow(); for (int i = 0; i < 3; i++) { TextBox tbox = new TextBox(); tbox.ID = i.ToString(); TableCell tc = new TableCell(); tc.Controls.Add(tbox); tr.Cells.Add(tc); tb.Rows.Add(tr); } Panel1.Controls.Add(tb); } protected void Button1_Click(object sender, EventArgs e) { Table t = (Table)Page.FindControl("Panel1").FindControl("tb1"); TextBox tbox; foreach (TableRow tr in t.Rows) { foreach (TableCell tc in tr.Cells) { foreach (Control c in tc.Controls) { if (c.GetType() == typeof(TextBox)) { tbox = (TextBox)c; Response.Write("TextBox ID = " + tbox.ID + "<br/>"); Response.Write("TextBox Text = " + tbox.Text + "<br/>"); } } } } }Brijesh Vaidya
India