Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 24th, 2006, 10:52 AM
Registered User
 
Join Date: Mar 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default having two submit buttons in asp page and passing

how to have two different buttons in a asp page(html) .
and how to pass the different parameters specific to buttons.
(something li9ke one button for edit -- with parameter action=edit and recordid of record to be modified , and onather add with action=add with new record id)

 
Old April 24th, 2006, 09:58 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I would change the type of button based on: are they editing or are they adding.

Anyhow:
;;;how to have two different buttons in a asp page
Place <input type="button" value="Edit Current Details" onclick="someName();"> tags on the page. Notice the onClick event that fire a JS function. Im not a fan unless you have no other choice (the user can not press the enter button to submit the form)

    function someName()
    {
       formName.action = 'pageName.asp?someQSName=someValue';
       formName.submit();
    }

You could pass values into the function or simply (as illustrated above) change the action and or QS values to post to you desired location. There are many ways to achieve you outcome


Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
2 buttons going to same ASP page chrscote Classic ASP Basics 1 June 1st, 2005 03:00 PM
2 Submit Buttons ... HOW? Benno Dreamweaver (all versions) 1 November 23rd, 2004 12:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.