ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 6th, 2003, 03:31 AM
catztay catztay is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Malaysia
Posts: 2 catztay User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question new to asp. multiple buttons in form q??

Hi all.. happy new year.
I'm new in asp. i have a problem with using 2 submit buttons in a form, i renamed the buttons and used some coding on it. i got an error message..."Error on Page" wat does that means?

how do i use 2 submit buttons in a form?

thanks in advance! @)~~

Reply With Quote
  #2  
Old January 6th, 2003, 09:09 AM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
here's one method:

http://www.loudasp.com/knowledgebas...id=33&faqid=884

but if you can give me a little more info in terms of what you are trying to accomplish, I can probably give you some more advice.

Reply With Quote
  #3  
Old January 6th, 2003, 10:57 AM
catztay catztay is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Malaysia
Posts: 2 catztay User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking

Thank you so much! thanks thanks
it works just fine...... :-)

thanks alot
catz tay

Reply With Quote
  #4  
Old January 6th, 2003, 07:14 PM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
glad it worked. Another option, which is a bit more complex is to define your buttons as follows:

Add button

<input type="submit" name="action" value="Add">

Delete button

<input type="submit" name="action" value="Delete">

and then have the page post back to itself and do a

cmdaction = Request.Form("action")

if cmdaction = "Add" then

'add the record to the database

elseif cmdaction = "Delete" then

'delete the record from the database

etc, etc.

If cmdaction = "" then

' display the form

Reply With Quote
  #5  
Old January 6th, 2003, 08:07 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
an easier way is to have one submit button and one normal button, then you set up the defaults for the submit button, then using javascript, you can submit the form with the normal button, for example

<form action="delete.asp" name="test" method="post">

<input type="submit" value="Delete">
<input type="button" value="Modify" onClick="document.test.action='modify.asp'; document.test.submit();">
</form>

so when you click submit it will change the action to modify.asp and submit the form

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > new to asp. multiple buttons in form q??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT