< Html Xmlns = "Http://www.w3.org/1999/xhtml" >
< Head Runat = "Server" >
< Title > Jquery Dynamic Control </ Title >
< Script SRC = "Jquery-1.4.2.js" Type = "Text/JavaScript" > </ Script >
< Script Type = "Text/JavaScript" >
$ ( Function (){
VaR I = 2 ;
$ ( ' # Addtext ' ). Click ( Function (){
If (I < 9 ){
$ ( ' # Main ' ). Append ( ' <Div> <input type = "text" name = "text" + I + ""/>
<A href = "#" class = "Del-text"> Del </a> </div> ' );
I ++ ;
} Else {
Alert ( " You can add up to 8 " );
}
});
$ ( ' . Del-Text ' ). Live ( ' Click ' , Function (){
$ ( This ). Parent (). Remove ();
I -- ;
});
});
</ Script >
</ Head >
< Body >
< Div ID = "Main" >
< Div >
< Input Type = "Text" Name = "Text1" />
</ Div >
</ Div >
< A ID = "Addtext" Href = "#" > Add text box </ A >
</ Body >
</ Html >
============
If the value is set, you can directly use request ["text" + I]. tostring () in the background.