Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 01:41 PM
Andrew Cheng
Guest
 
Posts: n/a
Default basic asp question


Hi all,
Can I submit more than one form on the same page? If yes, how do I
reference the request field on different form? I tried the following
and not working. Is there any sample code out there? Thanks.

request.form("form_a")("Name")


request.form("form_b")("Status")

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2  
Old July 19th, 2005, 01:41 PM
Ray at
Guest
 
Posts: n/a
Default Re: basic asp question

No, you cannot. Is there any reason that you cannot have all the fields in
one <form></form> though?

Ray at home

"Andrew Cheng" <andyandyan@yahoo.com> wrote in message
news:u3dNFFOTEHA.240@TK2MSFTNGP11.phx.gbl...[color=blue]
>
> Hi all,
> Can I submit more than one form on the same page? If yes, how do I
> reference the request field on different form? I tried the following
> and not working. Is there any sample code out there? Thanks.[/color]


  #3  
Old July 19th, 2005, 01:41 PM
Ken Schaefer
Guest
 
Posts: n/a
Default Re: basic asp question

You can't submit more than one form.

Also, on the server-side, the server has no concept of the layout of your
page (or the number of forms on it). All it sees is the data submitted by
the browser. So, if the first form contained an element called "firstname",
and the second form contained an alement called "status" then you'd still
do:

Request.Form("name")
Request.Form("status")

It's just that one of those two would be blank.

Now, your options are:
a) put everything into one big form
-or-
b) when you submit either form, use some client-side javascript to copy all
the values in the other form into hidden form elements in the form being
submitted. Obviously this relies on the client supporting/allowing
javascript.

Cheers
Ken


"Andrew Cheng" <andyandyan@yahoo.com> wrote in message
news:u3dNFFOTEHA.240@TK2MSFTNGP11.phx.gbl...
:
: Hi all,
: Can I submit more than one form on the same page? If yes, how do I
: reference the request field on different form? I tried the following
: and not working. Is there any sample code out there? Thanks.
:
: request.form("form_a")("Name")
:
:
: request.form("form_b")("Status")
:
: *** Sent via Devdex http://www.devdex.com ***
: Don't just participate in USENET...get rewarded for it!


  #4  
Old July 19th, 2005, 01:41 PM
Evertjan.
Guest
 
Posts: n/a
Default Re: basic asp question

Ken Schaefer wrote on 08 jun 2004 in
microsoft.public.inetserver.asp.general:
[color=blue]
> Now, your options are:
> a) put everything into one big form
> -or-
> b) when you submit either form, use some client-side javascript to
> copy all the values in the other form into hidden form elements in the
> form being submitted. Obviously this relies on the client
> supporting/allowing javascript.[/color]

Just give the input elements different names:

<form id="formone" method="post">
<input name="form1-street">
<input name="form1-town">
</form>
<form id="formtwo" method="post">
<input name="form2-street">
<input name="form2-town">
</form>

Look daddy, no clientside javascript!

serverside vbs or js:

form1-street = Request.form("form1-street")
form1-town = Request.form("form1-town")
form2-street = Request.form("form2-street")
form2-town = Request.form("form2-town")


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
  #5  
Old July 19th, 2005, 01:41 PM
Andrew Cheng
Guest
 
Posts: n/a
Default Re: basic asp question


Thank you all. I will work around using fields naming convention.


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles