Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Multiple Form Elements

Status
Not open for further replies.

pingit

MIS
Nov 24, 2003
37
0
0
NZ
Hello All
I have a java function that creates a form with a dynamic number of "inputs" and sends it to an asp page
The asp page is surposed to cycle through and Response.Write the elements
The asp only shoes the first two words of the first element
I have included the asp code and the function(the asp is first) im new to this and any help is much appreciated

Thanks is advance
ASP#######################
for i=1 to Request.Form("theform").Count
Response.Write(Request.Form("theform")(i) & "<br />")
next

JAVA FUNCTION#############

function postit(where){
var theform=document.createElement('form')
with (theform) {
action=where
method='post'
}
document.body.appendChild(theform)
for (var i=0,l=strSql.length;i<l;i++) {
var theinput=document.createElement('input')
with (theinput) {
type='hidden'
name='thearray['+i+']'
value=strSql
alert(strSql)
}
theform.appendChild(theinput)
}
theform.submit()
}
 
[0] The economy of alphabets is wrongly applied.
>JAVA
[tt]Javascript[/tt]

[1]
[1.1] html page
>name='thearray['+i+']'

One option to do is this.
[tt] name='[blue]thearray[/blue]'[/tt]

[1.2] the asp response
[tt]
for i=1 to Request.Form("[blue]thearray[/blue]").Count
Response.Write(Request.Form("[blue]thearray[/blue]")(i) & "<br />")
next[/tt]
 
To get ALL the values of a "post", you can use this:

Code:
<%
for each field in request.form
response.write field & ": " & request.form(field) & "<br />"
next
%>


--------

GOOGLE is a great resource to find answers to questions like "how do i..."


--------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top