|
-
Nov 7th, 2001, 09:53 AM
#1
Thread Starter
Addicted Member
Find out which button was clicked
I am very new to internet development, so please bear with me.
There are 3 forms: form1, form2, and report1.
On form1, I have two buttons, button1 and button2.
When you select either of these buttons you are sent to form2.
On form2, there is vbScript to determine which button was selected to determine what is going to happen next. The code to determine which button was selected is not right. How do I fix this?
if session("CurrentAppl") = "Session1" then
temp = UpdateInetBankingInfo() 'Updates info submitted on form1
if Request.Form("button2") = clicked then
Response.Redirect ("report1.asp")
end if
end if
Normal is boring...
 smh 
-
Nov 7th, 2001, 10:09 AM
#2
Black Cat
In HTML, give your button a name and a value:
<input type="submit" name="MyName" value="MyValue">
Then in ASP:
If Request.Form("MyName") = "MyValue" Then
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Nov 7th, 2001, 10:19 AM
#3
Thread Starter
Addicted Member
This is what the button is on the first form.
<input type="button" value="Print Application" id="button2"
name="btnSubmit2" size="22" onclick="ck_Values()">
I can not use the type 'submit' because it has to go through data validation before it leaves the page for the new data entered. If I use a submit button and the data is wrong, it will display the error message and leave the form without having the user fix the invalid data.
Normal is boring...
 smh 
-
Nov 7th, 2001, 11:03 AM
#4
Frenzied Member
Code:
<input type="button" value="Print Application1" name="btnSubmit" onclick="ck_Values()">
<input type="button" value="Print Application2" name="btnSubmit" onclick="ck_Values()">
Code:
which = Request.Form("btnSubmit")
'Which will be "Print Application1" or "Print Application2"
Another way to follow...
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Nov 7th, 2001, 11:05 AM
#5
Thread Starter
Addicted Member
Normal is boring...
 smh 
-
Nov 7th, 2001, 11:08 AM
#6
Frenzied Member
Code:
<input type="button" name="btnSubmit" onclick="ck_Values(1)">
<input type="button" name="btnSubmit" onclick="ck_Values(2)">
Code:
<script type="text/javascript">
function ck_Values(which) {
var which = Number(which);
//Do validation
document.myForm.myHiddenInput.value = which;
document.myForm.submit;
}
</script>
Code:
<input type="hidden" name="myHiddenInput" value="">
All that goes on the same page. The second page asks for Request.Form("myHiddenInput").
By the way... anyone seen any official documentation on how JavaScript/ECMAScript should handle form elements?
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Nov 7th, 2001, 01:13 PM
#7
Black Cat
Travis, this page
http://www.w3.org/TR/1998/REC-DOM-Le...-one-html.html
and the Rhino are what I use. Kind of outdated, but usually gets the job done.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Nov 7th, 2001, 01:28 PM
#8
Frenzied Member
All this time I've been looking at the DOM Level 3 Recs. There is stuff in the Level 1 Rec that isn't in the Level 3 Rec. Am I to assume that stuff is still accepted as standard, or has been depreciated?
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|