By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,474 Members | 939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,474 IT Pros & Developers. It's quick & easy.

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

P: 81
Hi,
How to Create textboxs using JavaScript in asp.net/c# and how to assign that values to a string?
Jul 22 '08 #1
Share this Question
Share on Google+
4 Replies


Plater
Expert 5K+
P: 7,872
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

P: 81
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
Expert Mod 5K+
P: 5,320
could you explain your requirement in more detail ... i just don't get it?

kind regards
Jul 25 '08 #4

acoder
Expert Mod 15k+
P: 16,027
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.