|
-
Sep 1st, 2005, 05:44 AM
#1
Thread Starter
Hyperactive Member
calling vbscript subroutine on form submit
Guys
I want to call a vbscript sub which asks the user to cofirm something when they hit the form submit button. At the moment, the onclick attribute calls document.frm.submit(); however I want to ask the customer to confirm their action before submitting the document.
I know how to do this in vb but not in javascript. I'd prefer to use vbscript than javascript as I am more familiar with vb but I don't know how to call the sub from this onclick event.
Any ideas?!
Cheers
Peter
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
-
Sep 2nd, 2005, 07:04 AM
#2
New Member
Re: calling vbscript subroutine on form submit
Try in the html declaration of your button following thing:
<asp:button id="myID" onClick="call your script" runat="server" />
in the codebehind you have your this document.frm.submit() standing. Normaly first the script will be called and then your code-behind.
I'm not 100% sure but I've done this in my website and it is working fine
-
Sep 4th, 2005, 06:51 PM
#3
Fanatic Member
Re: calling vbscript subroutine on form submit
Hi,
do this...
<script language="Javascript">
function submitbutton() {
if (confirm("are you sure")) = "true" then
document.frm.submit()
end if
}
</script>
The for is to have no submit button, jsut a hidden button with a name and value then
<%
if request("hiddenname") <> "" then
do something
end if
%>
try that, and happy days..
ta
kai
As the information I give is useful in its nature, consider using the RATE POST feature located on the bottom left of this post please..
A few things that make a good Developer a Great One.
Methodical and a thorough approach to research and design inevitably leads to success.
Forward thinking is the key to Flow of control.
Never test in the design environment, always test in real time, you get the REAL results.
CBSE & OOSE are the same animal, they just require different techniques, and thinking.
SEO is a globe of objectives, SE rankings is an end to a means for these objectives, not part of them.
The key to good design is explicit attention to both detail and response.
Think Freely out of the "Box" you're in..... You will soar to better heights.
Kai Hirst - MSCE, MCDBA, MCSD, MCP, MCAP, MSCT
-
Sep 9th, 2005, 07:38 AM
#4
Thread Starter
Hyperactive Member
Re: calling vbscript subroutine on form submit
 Originally Posted by spyatnoon
Try in the html declaration of your button following thing:
<asp:button id="myID" onClick="call your script" runat="server" />
in the codebehind you have your this document.frm.submit() standing. Normaly first the script will be called and then your code-behind.
I'm not 100% sure but I've done this in my website and it is working fine
I'm not using asp.net.......
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
-
Sep 9th, 2005, 07:50 AM
#5
Thread Starter
Hyperactive Member
Re: calling vbscript subroutine on form submit [resolved]
 Originally Posted by kaihirst
Hi,
do this...
<script language="Javascript">
function submitbutton() {
if (confirm("are you sure")) = "true" then
document.frm.submit()
end if
}
</script>
The for is to have no submit button, jsut a hidden button with a name and value then
<%
if request("hiddenname") <> "" then
do something
end if
%>
try that, and happy days..
ta
kai 
Sorry, been away sunning myself in the Costa Blanca....
Currently have this:
HTML Code:
function confirmSubmit()
{
var agree = confirm("Are you sure you wish to continue?");
if (agree)
document.frm.submit();
//return true;
else
return false;
}
I'm calling this from an a href tag:
HTML Code:
<a href='#' onclick='return confirmSubmit()'>Proceed</a>
with the form header:
HTML Code:
<form name="frm" method="post" action="process.asp">
Seems to work ok now, thanks.
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
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
|