How to insert a reference to a user in my entry?
Two submit buttons within one <form>
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > ASP web-programming > Two submit buttons within one <form> 14 August 2008 17:10:16

  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Two submit buttons within one <form>

Mike P 14 August 2008 17:10:16
 Can you have 2 submit buttons in one <form> element? I have a form with
a few dropdowns and textboxes that has a submit button to write the data
to a database, but I also need a submit button next to one of the
dropdowns to respond to whatever has been selected in the dropdown,
which will then populate one of the text boxes. How can I do this?


*** Sent via Developersdex http://www.develope­rsdex.com ***
Add comment
Bob Barrows 14 August 2008 16:07:38 permanent link ]
 Mike P wrote:
Can you have 2 submit buttons in one <form> element?

I don't see why not, but I've never tried it. Why don't you try it and let
us know?

I have a form
with a few dropdowns and textboxes that has a submit button to write
the data to a database, but I also need a submit button next to one
of the dropdowns to respond to whatever has been selected in the
dropdown, which will then populate one of the text boxes. How can I
do this?
Well, a second submit button will submit the same form as the first one, so
you will need to provide some way for the target page to tell whether to
simply provide the information for your cascading dropdown or to write the
data to the database.

See here for some alternative approaches:
http://classicasp.a­spfaq.com/forms/how-­do-i-make-one-dropdo­wn-depend-on-another­.html

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Add comment
Evertjan. 14 August 2008 17:10:16 permanent link ]
 Bob Barrows [MVP] wrote on 14 aug 2008 in
microsoft.public.in­etserver.asp.general­:

Mike P wrote:
Can you have 2 submit buttons in one <form> element?
I don't see why not, but I've never tried it. Why don't you try it and
let us know?
I have a form
with a few dropdowns and textboxes that has a submit button to write
the data to a database, but I also need a submit button next to one
of the dropdowns to respond to whatever has been selected in the
dropdown, which will then populate one of the text boxes. How can I
do this?
Well, a second submit button will submit the same form as the first
one, so you will need to provide some way for the target page to tell
whether to simply provide the information for your cascading dropdown
or to write the data to the database.

<f...='post'.....
<input type='submit' name='mySubmit' value='number1'>
<input type='submit' name='mySubmit' value='number2'>

...........

<%
if request.form("mySub­mit")="number1" then
'' first one pressed
elseif request.form("mySub­mit")="number2" then
'' other one pressed
else
'' possibly js triggered: d...form[x].submit();
end if

not tested

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > ASP web-programming > Two submit buttons within one <form> 14 August 2008 17:10:16

see also:
XML Config
JAXM Compatibility?
FW: filter url-mapping="/" applies to…
пройди тесты:
see also:

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .