0
< form name=form1>
<%
int  x = 0;
while ( x < 10)
{
%>
<label name="<%=x%>"> <input type=textbox name=inaki>

<br>
<%
x = x + 1;
}
%>
<input type=button value=go onclick="doit(this)">
</form>
<script>

function doit(sthg)
{
var x = 0;
while(  x < 100)
{
alert(document.form1.inaki[x].value);
x = x+1;
}
}
</script>

Very simple code. I am doing 10 textboxes. And to access it am using document.form1.inaki[x].value.. i am accessing each textbox.
but how can i access the lable name for each texbox.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by javaAddict
0

plz help its urgent.The project is bigger, but am stuck at this point.

I am in fact reading from database, creating the label names based on it. And each label name i have textbox for it. I need to send the labels + textbox values together as parameters. I am basically using document.location.href in the function doit(sthg)..

if u just help me in doing that small sample. my whole big project is solved.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.