web 2.0

How to used ASP & Multiple Input Text Field/Textbox

How to used ASP &  Multiple Input Text Field/Textbox This the tutorial/example a scripts how to use ASP & Multiple Input Text Field/Textbox

ShotDev Focus:
- ASP & Multiple Input Text Field/Textbox

Example 1 (Static Textbox)

asp_multiple_textbox1.asp


<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<form action="asp_multiple_textbox2.asp" method="post" name="form1">
<input type="text" name="txtSiteName"><br>
<input type="text" name="txtSiteName"><br>
<input type="text" name="txtSiteName"><br>
<input name="btnSubmit" type="submit" value="Submit">
</form>
</body>
</html>

asp_multiple_textbox2.asp


<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Dim i
i = 0
For Each txtVol in Request.Form("txtSiteName")
Response.write "txtSiteName " & i & " = " & txtVol & "<br>"
i = i + 1
Next
%>
</body>
</html>

Create a asp file and save to path root-path/myasp/

Run
http://localhost/myasp/asp_multiple_textbox1.asp

Screenshot

ASP & Multiple Input Text Field/Textbox

ASP & Multiple Input Text Field/Textbox
.

Example
2 (Dynamic Create Textbox)

asp_multiple_textbox3.asp


<html>
<head>
<title>ShotDev.Com Tutorial</title>
<script language="javascript">
function fncCreateElement(){

var mySpan = document.getElementById('mySpan');

var myElement1 = document.createElement('input');
myElement1.setAttribute('type',"text");
myElement1.setAttribute('name',"txtSiteName");
mySpan.appendChild(myElement1);

var myElement2 = document.createElement('<br>');
mySpan.appendChild(myElement2);
}
</script>
</head>
<body>
<form action="asp_multiple_textbox4.asp" method="post" name="form1">
<input type="text" name="txtSiteName">
<input name="btnButton" type="button" value="+" onClick="JavaScript:fncCreateElement();"><br>
<span id="mySpan"></span>
<input name="btnSubmit" type="submit" value="Submit">
</form>
</body>
</html>

asp_multiple_textbox4.asp


<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Dim i
i = 0
For Each txtVol in Request.Form("txtSiteName")
Response.write "txtSiteName " & i & " = " & txtVol & "<br>"
i = i + 1
Next
%>
</body>
</html>

Create a php file and save to path root-path/myasp/

Run
http://localhost/myasp/asp_multiple_textbox3.asp

Screenshot

ASP & Multiple Input Text Field/Textbox

ASP & Multiple Input Text Field/Textbox
.
.
.

Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (2 votes, average: 5.50 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.