468,760 Members | 1,913 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,760 developers. It's quick & easy.

How to Create textboxs using JavaScript and pass value to asp.net/c#

Hi,
How to Create textboxs using JavaScript in asp.net/c# and how to assign that values to a string?
Jul 22 '08 #1
4 1505
Plater
7,872 Expert 4TB
So your real question is how to create textboxes in javascript?
I will move it to the javascript forum then.
MODERATOR
Jul 22 '08 #2
Hi,
Iam creating Dynamic textboxs using javascript in asp.net. now i want to get that textboxs value in a string. How can i get that one?

My code:
[HTML] <script language="javascript">
var i=0;
function changeIt()
{
if(i<5)
{
i =i+1;
my_div.innerHTML = my_div.innerHTML +"<input type='text' name='Skill'+ i>&nbsp;"
}
else
{
}
}
</script>

<div id="my_div">
&nbsp;<input id="Text1" type="text" /><a id="addSkills" href="javascript:changeIt();" >Add More...</a> </div>[/HTML]
Jul 23 '08 #3
gits
5,390 Expert Mod 4TB
could you explain your requirement in more detail ... i just don't get it?

kind regards
Jul 25 '08 #4
acoder
16,027 Expert Mod 8TB
document.createElement("input") will create an input element to which you can set the attributes using the properties or setAttribute.
Jul 29 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Steve Neill | last post: by
3 posts views Thread by takarimasu | last post: by
1 post views Thread by quickcur | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.