[thelist] Brain fart html w/asp (revisited)

Cymbala, Greg Greg.Cymbala at Den.Galileo.com
Fri Apr 26 11:18:01 CDT 2002


Your sub saveArticle() lives on the server.  Your onClick="saveArticle()"
lives on the client browser.  They don't know about each other.  You get
that error because IE says, "there's no client-side JavaScript or VBScript
function called "saveArticle()".  I don't know what you're talking about."

You would actually have to have a form POST (or GET) to do what you're
after.

Like:

<%@LANGUAGE="VBSCRIPT"%>
<%
If Request.Form("Save") = "Save and Exit" Then
	' We got a post
	saveArticle
Else

End If

Sub saveArticle()
	Dim stuff, stuff_1, stuff_2
	'rest is commented out
	Response.Write("<p>Sub saveArticle() was called.</p>")
End Sub

%>
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<form method="POST" name="frmSaveArticle">
   <input type="submit" name="Save" value="Save and Exit" />
</form>
</BODY>
</HTML>

-----Original Message-----
From: Rob Smith [mailto:rob.smith at thermon.com]
Sent: Friday, April 26, 2002 10:10 AM
To: Thelist (E-mail)
Subject: [thelist] Brain fart html w/asp (revisited)


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]

Hi

This about calling ASP 2.0 functions from html forms...again.

Here's what I have

<%@LANGUAGE="VBSCRIPT"%>
<%
sub saveArticle()
	dim stuff, stuff_1, stuff_2
	'rest is commented out
end sub
%>

...

<form>
   <input type="button" name="Save" value="Save and Exit"
onClick="saveArticle()"> </form

When I try to click on the button in the web browser, IE5(? matters not)
throws an error: "Object expected"

What could possibly be wrong with this? missing anything?

Thanks in advance,

Rob


The information in this electronic mail message is sender's business
Confidential and may be legally privileged.  It is intended solely for the
addressee(s).  Access to this Internet electronic mail message by anyone
else is unauthorized.  If you are not the intended recipient, any
disclosure, copying, distribution or any action taken or omitted to be taken
in reliance on it is prohibited and may be unlawful.
The sender believes that this E-mail and any attachments were free of any
virus, worm, Trojan horse, and/or malicious code when sent. This message and
its attachments could have been infected during  transmission. By reading
the message and opening any attachments, the recipient accepts full
responsibility for taking protective and remedial action about viruses and
other defects. Galileo International is not liable for any loss or damage
arising in any way from this message or its attachments.





More information about the thelist mailing list